Click here to Skip to main content
15,905,427 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Extract string from CString Pin
Rajkumar R6-Feb-08 0:15
Rajkumar R6-Feb-08 0:15 
NewsRe: Extract string from CString Pin
Rajesh R Subramanian6-Feb-08 1:23
professionalRajesh R Subramanian6-Feb-08 1:23 
GeneralRe: Extract string from CString Pin
Rajkumar R6-Feb-08 1:30
Rajkumar R6-Feb-08 1:30 
GeneralRe: Extract string from CString Pin
Rajesh R Subramanian6-Feb-08 1:45
professionalRajesh R Subramanian6-Feb-08 1:45 
GeneralRe: Extract string from CString [modified] Pin
Rajkumar R6-Feb-08 1:49
Rajkumar R6-Feb-08 1:49 
QuestionDhcpRequestParams() Pin
Ajay L D5-Feb-08 0:15
Ajay L D5-Feb-08 0:15 
QuestionRe: DhcpRequestParams() Pin
David Crow14-Mar-08 5:50
David Crow14-Mar-08 5:50 
Generalhidden window Pin
Kogee San4-Feb-08 23:45
Kogee San4-Feb-08 23:45 
Hello

I have a problem on how to hide an application running in hidden mode. I found a code to hide the window. This code will hide all windows including the dos window. The code is :-

<br />
#include <windows.h><br />
<br />
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)<br />
{<br />
while(1)<br />
{<br />
Sleep(1000);<br />
}<br />
<br />
return 0;<br />
}<br />
<br />
main()<br />
{ <br />
   /* This is where all of the codes including function calls and API <br />
      calls is placed here. Example the InitWSA()for initializing        <br />
      windows socket and other API calls */<br />
}<br />
<br />
</windows.h>


Im not sure what does this code do but since i already test the code, it really hides the dos window.

A brief about my system, i created client server based application using a win32 console application where the client will communicate and send messages to the server. The network part has already be done and the client currently can send messages to the server meanwhile the server has no problem to display the sent messages from the client. So this means that the client-server part has no problem. One of the requirement of my application is that the client application must be hidden from the user. So, I used the code above to hide the dos window from being seen by the user. At first, the code above didnt work (the dos window can still be seen). There was no error but after i had done some research, i realize that it couldn't work because the linker setting of the project under system tab is by default set to Console (/SUBSYSTEM:CONSOLE). So i changed this setting to Windows (/SUBSYSTEM:WINDOWS). Then after i change these settings, the code above works (the dos window is hidden). How did i know that the code works is because i checked the Windows Task Manager and i saw that under processes tab, there is my *.exe is executing. The problem is that the network part didnt work since the server didnt receive any messages from the client.

Then i differentiate the application running under Windows (/SUBSYSTEM:WINDOWS) with the one running under Console (/SUBSYSTEM:CONSOLE). I realize that when the application is running under /subsystem:windows and it is hidden, the windows task manager will display only at the processes running. For instance: my project name is hidden.exe. So, hidden.exe will be displayed only at the Processes running tab. There is no display under the Application running tab. But when i change to /subsystem:console and the dos window can be seen by user, i found that the windows task manager will display hidden.exe at the Application tab meanwhile at the Processes tab, it only display cmd.exe is running, not hidden.exe.

Im not sure is this the correct method to hide a window from users view. My priority is that the client application running under dos window cannot be seen by the user which means it is hidden and at the same time, the client which is hidden is sending messages to the server and the user doesnt know that the client application is sending messages to the server. Is there any opinion or help? I really appreciate for any help or opinion. Thanks Big Grin | :-D
GeneralRe: hidden window Pin
Rajkumar R5-Feb-08 2:12
Rajkumar R5-Feb-08 2:12 
GeneralRe: hidden window Pin
Kogee San5-Feb-08 14:36
Kogee San5-Feb-08 14:36 
GeneralRe: hidden window Pin
Rajkumar R5-Feb-08 19:35
Rajkumar R5-Feb-08 19:35 
GeneralRe: hidden window Pin
David Crow5-Feb-08 2:41
David Crow5-Feb-08 2:41 
GeneralMeasuring elapsed time regardless of the actual real time Pin
JC90794-Feb-08 23:34
JC90794-Feb-08 23:34 
GeneralRe: Measuring elapsed time regardless of the actual real time Pin
Cedric Moonen4-Feb-08 23:40
Cedric Moonen4-Feb-08 23:40 
GeneralRe: Measuring elapsed time regardless of the actual real time Pin
JC90794-Feb-08 23:44
JC90794-Feb-08 23:44 
GeneralCStringList to LPTSTR[] Pin
azusakt4-Feb-08 22:51
azusakt4-Feb-08 22:51 
QuestionRe: CStringList to LPTSTR[] Pin
CPallini4-Feb-08 22:58
mveCPallini4-Feb-08 22:58 
GeneralRe: CStringList to LPTSTR[] Pin
azusakt4-Feb-08 23:09
azusakt4-Feb-08 23:09 
GeneralRe: CStringList to LPTSTR[] Pin
CPallini4-Feb-08 23:17
mveCPallini4-Feb-08 23:17 
GeneralRe: CStringList to LPTSTR[] Pin
azusakt4-Feb-08 23:25
azusakt4-Feb-08 23:25 
GeneralRe: CStringList to LPTSTR[] Pin
CPallini4-Feb-08 23:39
mveCPallini4-Feb-08 23:39 
GeneralRe: CStringList to LPTSTR[] Pin
Cedric Moonen4-Feb-08 23:03
Cedric Moonen4-Feb-08 23:03 
GeneralRe: CStringList to LPTSTR[] Pin
azusakt4-Feb-08 23:08
azusakt4-Feb-08 23:08 
GeneralRe: CStringList to LPTSTR[] Pin
CPallini4-Feb-08 23:32
mveCPallini4-Feb-08 23:32 
GeneralRe: CStringList to LPTSTR[] Pin
Cedric Moonen4-Feb-08 23:37
Cedric Moonen4-Feb-08 23:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.