Hello, buddies, My program is a Win32 screen-saver program(ie, .SCR file), during its running process, it will launch another Win32 program to do certain things, and after this screen-saver program exits, that Win32 program may pop up a window for showing some information to the user. Here's my problem: on the WinNT-based platform (WinNT/2K/XP), when the screen-saver is set to be password protected (ie, the user needs to input the password to login the system after the screen-saver exits), the Win32 program which launched by the screen-saver is immediately terminated also when the screen-saver exits, so that Win32 program doesn't have the opportunity to show the information dialog. It's seem that That Win32 program is terminated by the system when the screen-saver ends, and this's maybe relate to something like "desktop switch", because the password-protected screen-saver is running on the so-called "screen-saver" desktop, and the other program launched by the screen-saver is also running on this desktop, the screen-saver ends, the "screen-saver" desktop disappears, so the other program dies as well... The above is my opinion for this problem, so I tried to do somethings like switch the desktop in the screen-saver and the other program, but failed, that problem still exists. So, does anyone can tell me: How to let the another program still run after the password-protected screen-saver ends? Thanks!
JoeZhang
Posts
-
Problem about screen-saver program... -
HELP! Winsock problem about the select function...hi, guys, In my current Winsock-based TCP program, on the client side, after I send my request data packet to the Server side using the send socket function, I attempt to get the socket status to see if it has something to read using the select function, and the select function always return 0 meaning the time limit expired on some users' computers, but it's just fine on another users' computers. Why? Does anybody can tell me why and how to fix it? Thanks! here's the code... //... SOCKET sckClient = socket(AF_INET, SOCK_STREAM, 0); int nOne = 1; setsockopt(sckClient, IPPROTO_TCP, TCP_NODELAY, (char *)&nOne, sizeof(int)); // just_say_no struct sockaddr_in addr_to = { 0 }; //... connect(sckClient, (struct sockaddr *)&addr_to, sizeof(addr_to)); char *buf; //... send(sckClient, (const char *)((char*)buf), nDataToSend, 0); int nRetCode = ::select((int)sckClient + 1, &fdsRead, NULL, NULL, &tvTimeOut); if (nRetCode==0 ) { //ERROR: the time limit expired //Here's the problem! some computers meet the error, but some don't! WHY??? } recv(sckClient,(char *)buf,nDataToRead, 0); //...
-
Capture input of the CommandWindowMake the output text of that console app into a disk file instead of printing to the command window, and then read the contents of the file into a memory buffer and parse that buffer for your needs... But how to do this in your program? here's a solution: Dynamically generate a .BAT batch file in your program, the contents of this batch file is like this: consoleApp.exe >> c:\output.txt Here, consoleApp.exe is the filename of that console app you want to capture its output, and then launch this batch file via CreateProcess win32 API. After the end of console app, what its outputs are placed into the output.txt file... Hope this helps.:laugh:
-
How to deal with multi-IP on TCP/IP programming mode?cmk wrote: ...This allows you to listen on all local address... Well, if you just "listen" and not "send" data,or the local host has ONLY one IP address, it would be fine. But by this way, if the local host has more than one IP address and you want to send data to the other host, it may not work sometimes, why? because "the underlying service provider" sometimes would automatically bind an "exist-but-not-connect" IP (though a host have several IP addresses, maybe only one or some connectable and others don't), and, of course, you cannot send data outside successfully via it... and this is approved in my current application :) What I mean "proper one" is: you cannot alway hope that the ADDR_ANY would do the right thing for you, you must find out the working and connectable IP address, and then bind your socket to it. :sigh: Thank you!
-
How to Comine two numbers, not addition.and, you can also... attach a int variable with your edit box 3, and then make it equal to c, and then call UpdateData(FALSE) to make it show in edit box 3...
-
How to Comine two numbers, not addition.oh, god...:) just attach a CString class variable with your edit box 3, and then make it equal to "szC", and then call UpdateData(FALSE) to make it show in edit box 3... ;P
-
How to Comine two numbers, not addition.How "it doesn't work for you"? what error occurred? szA,szB,szC just are temporary char string variables.
-
How to Comine two numbers, not addition.hey, guy, try this... :) ... char szA[100], szB[100], szC[200]; int c; printf(szA,"%d",a); //here, a is a int number entered on edit box 1. printf(szB,"%d",b); //here, b is a int number entered on edit box 2. strcpy(szC,szA); strcat(szC,szB); c = atoi(szC); //here, c is the int number you want, just place it into edit box 3 ... hope this helps! ;)
-
How to deal with multi-IP on TCP/IP programming mode?Hi… there, I wonder how you guys deal with the case of more than one available IP address (multi-IP) on the local host on the TCP/IP programming mode. I'm talking about the "multi-IP" here, it's usually the system which installed with more than one network adapter (physical or virtual), i.e., more than one available IP address… In the case, when you call the socket API "bind" to bind your socket with the local host, you must choose the proper IP address from the multiple IP addresses, otherwise, your socket possibly cannot work. So, my problem is: how do you know which IP address is available on that LAN? The current solution I'm using is: Present a dialog with a list control, and all the available local IP addresses listed on the list control, then ask the user select the proper one that my program would use... :) Does anyone here can tell another better solution to this problem? i.e., how does my program automatically detect all the IP addresses, then automatically pick up the proper one, instead of asking the user for this? Thanks!
-
The synchronization issue on sending and receiving data via UDP Multicast...Well, big thanks to Roger and Johnny... :) Now, I'm searching something useful on SourceForge.net...
-
The synchronization issue on sending and receiving data via UDP Multicast...Hi, there... I’m now getting a problem: In my current Winsock2-based application, I need to deliver lots of data from the Server side to more Client sides via the UDP multicast mode. However, one or more Client sides cannot receive some data blocks sometimes After a hard debug process, I found the program is: the Server multicasts the data too fast, and the Client cannot receive all the sent blocks of data in time, i.e., the process speed of Client is more slower than the Server, some block of data is overcastted by the next block before the Client gets it At this time, to avoid this, I delay some time using the Sleep API after each block of data sent on the Server side. Though that’s not a best way, it works. But another program brings out – It’s hard to know how long I exactly delay: if the delay is too long, the more unnecessary time used to deliver; if it’s too short, some Clients may still lost some blocks of – It’s just hard to control the delay time after each block of data sent Does anyone can tell me another better way to synchronize the speed of sending and receiving data on both Server side and Client sides? Thanks!
-
active screensaver ProgrammaticallyDoes anyone can tell me how to active the screensaver programmatically on MS Windows platform?
-
Show my dialog outside the Win2k "locked" screen...thanks! So, how can I do that?
-
Show my dialog outside the Win2k "locked" screen...Hey,all... My current Win32 application would do some background job while Windows enters the "screensaver" status, and it would shows a top-most dialog outside the screensaver's screen for displaying the working status and progress. But now I encounter a problem: while the option "On resume, password protect" is set on the screensaver setting dialog in Win2K/XP, the dialog box on my application cannot be showed outside the screensaver screen, but if this option is not set, it do. Does anyone can tell me how to solve this problem? Thanks!
-
Visual Studio InstallerAsk the user manually install this packet before launch your installer:-O
-
My own Version- Using the GetFileVersionInfo Win32 API, refer to MSDN for usage; -OR- 2) Add a export function,say GetVersionNember,into your DLL for query its version number by its customer(client),the following is a simple example,
//... const WORD LOW_VER_NUM = 0; const WORD HIGH_VER_NUM = 1; //... DWORD GetVersionNumber() { return MAKELONG(LOW_VER_NUM,HIGH_VER_NUM); }
Hope this helps!;P
- Using the GetFileVersionInfo Win32 API, refer to MSDN for usage; -OR- 2) Add a export function,say GetVersionNember,into your DLL for query its version number by its customer(client),the following is a simple example,
-
Visual Studio InstallerThe executable file cannot execute itself until the user,the system or the other program launchs it! By the way,what's your installer for? why you dont want to add the line of code?
-
Checking a Language !The GetSystemDefaultLangID Win32 API meets your need, please go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_4ppg.asp for more details.
-
Video in a Window using Visual c++Just using Windows Media SDK, go to http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwmt/html/wmsdk.asp for more information. Hope this helps!
-
Visual Studio InstallerNormally, each a software packet has a file,named setup.exe or install.exe,that executes the task of install this software to user's harddisk. Just launch this executable file during your install program via the CreateProcess Win32 API, for more information and usage about CreateProcess,please click http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createprocess.asp