Re: Using AttachConsole() to run GUI app in command prompt console
From: Rhett Gong [MSFT] (v-raygon_at_online.microsoft.com)
Date: 04/21/04
- Next message: Stefan Goerres: "Re: Effective User Rights on Key under System Service?"
- Previous message: Alexander Grigoriev: "Re: Having problems with device notifications"
- In reply to: Pieter: "Re: Using AttachConsole() to run GUI app in command prompt console"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 21 Apr 2004 07:12:12 GMT
After we discussed in your previous post, my thought truns to the entry point of an .exe. Since when we link an application, we use /SUBSYSTEM:CONSOLE to
indicate mainCRTStartup and use /SUBSYSTEM:WINDOWS to indicate WinMainCRTStartup. And we can use the linker option /ENTRY to specify the starting
address for an .exe, I thought if we could use "/SUBSYSTEM:WINDOWS /ENTRY:myMain" I do something like this (pseudo code):
//-----------------------------------------------------------------------------------
int __stdcall main(int argc, char **argv)
{
If( argv == GUI)
{
// call
hInst = GetModuleHandle(NULL);
myWMain(hInst,NULL,NULL,1);
//...........
}
else
{
// execute useful functions here
}
return 0;
}
//----------------------------------------------------------------------------------
Good Luck!
Rhett Gong [MSFT]
Microsoft Online Partner Support
This posting is provided "AS IS" with no warranties, and confers no rights.
Please reply to newsgroups only. Thanks.
- Next message: Stefan Goerres: "Re: Effective User Rights on Key under System Service?"
- Previous message: Alexander Grigoriev: "Re: Having problems with device notifications"
- In reply to: Pieter: "Re: Using AttachConsole() to run GUI app in command prompt console"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|