![]() |
![]() |
![]() |
|
|
|||||||
| Chit-Chat Relax for a bit and have a general conversation (off topic is allowed!) with other members. Please be polite and respect your fellow members. |
|
|
Thread Tools | Display Modes |
|
|
(permalink) |
|
Perhaps it would be easyer to find a site or a book about MFC ?
You can't expect to just jump into MFC and everything to work out. You might also want to pick up a good c++ book. All you've been doing up until now is writing C code and using a C++ compiler to compile it. |
|
|
|
|
|
|
(permalink) |
|
i prefer c to c++ because c is more simple than c++ and does the some job.
__________________
when you post that reply, im just kidding. |
|
|
|
|
|
|
(permalink) |
|
MFC is based upon object oriented programming.
The only way to write MFC applications is in C++, it's not possible in C. |
|
|
|
|
|
|
(permalink) |
|
so that means the code i writen won't work
__________________
when you post that reply, im just kidding. |
|
|
|
|
|
|
(permalink) |
|
It means you can't hide your program. You need a window handle for that, wich is only given to real windows applications, console applications have no handle.
The easyest and quickest way to write a windows program is by using MFC. |
|
|
|
|
|
|
(permalink) |
|
isnt it possible to do it in the regestry to hide it to the tray :?:
__________________
when you post that reply, im just kidding. |
|
|
|
|
|
|
(permalink) |
|
danielsmusic,
You only want to hide your window? I thought you wanted the process to completely disappear (not listed in the Task Manager). Hiding your window is pretty easy, and doesn't require MFC at all, even less so .NET... :roll: You simply need to use the Win32 API directly (windows.h), and it can be done in a console app. Note that there must be hundreds of ways to do this. Here's one : Code:
#include <windows.h>
int main(int argc, char* argv[])
{
printf("Hello World!\n");
Sleep( 2000 );
HWND hw = FindWindow( "ConsoleWindowClass", "C:\\projects\\hidden\\release\\hidden.exe" );
ShowWindow( hw, SW_HIDE );
Sleep( 2000 );
ShowWindow( hw, SW_SHOW );
Sleep( 2000 );
return 0;
}
It's not an elegant solution, but like I said, there are several ways to do this, I just never had to do this with a console app, so that's the best I can come up with off the top of my head. Maybe a Win32 guru will chime in. You obviously only need those 2 lines : Code:
HWND hw = FindWindow( "ConsoleWindowClass", "C:\\projects\\hidden\\release\\hidden.exe" ); ShowWindow( hw, SW_HIDE );
__________________
Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ |
|
|
|
|
|
|
(permalink) | |
|
Quote:
See previous post :cool: Anything that shows on your desktop has a window handle. You just have to figure out a way to find it.
__________________
Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ |
||
|
|
|
|
|
(permalink) |
|
im on xp pro, what demo program?
__________________
when you post that reply, im just kidding. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
Note that it doesn't work when launched from Visual Studio's IDE. You need to launch (double-click or run from the command line) the .exe yourself. When launched from the IDE, the title bar text is enclosed in double quotes...
__________________
Time is nature\'s way of keeping everything from happening at once. http://membres.lycos.fr/jrainville/ |
||
|
|
|
|
|
(permalink) |
|
thanks,
i needed to shutdown my computer from another room so i will create a program that will read commands from a file and the other program will write to that file remotely. i have ideas for it.
__________________
when you post that reply, im just kidding. |
|
|
|
|
|
|
(permalink) | |
|
Quote:
|
||
|
|
|
|
|
(permalink) |
|
yea :evil: , why don't microsoft make anything simple? i get that same answer when i google around. thanks for the post though :wink:
__________________
when you post that reply, im just kidding. |
|
|
|
|