Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Win Apps

 
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) Printable version
View previous topic :: View next topic  
Author Message
JackFoo
Senior Member
Senior Member


Joined: 05 Feb 2003
Posts: 373
Location: ERROR

PostPosted: Wed Mar 19, 2003 12:56 pm    Post subject: Win Apps Reply with quote

Hi, I've been thinking of rewriting lst2str into a windows app. instead of a console app.; However I have no experience with win. apps, I replaced
Code:
int main(int argc, char *argv[])

with:
Code:
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)

and am now calling the argv as __argv and the same for argc, however despite these changes I can still see the console window popping up, any help would be greatly appreciated.
P.S. All pure C, no C++ or delphi please ;-).

Chears.
Back to top
View user's profile Send private message
Aezay
Senior Member
Senior Member


Joined: 12 Feb 2003
Posts: 247
Location: Denmark

PostPosted: Wed Mar 19, 2003 1:08 pm    Post subject: Reply with quote

I dont really know, but since there's an Image Subsystem value in the Portable Executeable Optional Header of the exe file, I would guess u have to tell the compiler that it's not a console app somehow.

This Image Subsystem value is 3 if its a console, and 2 if GUI.
_________________
Of all the planets I've been to, this one is my favorite.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
soreno
Junior Member
Junior Member


Joined: 13 Feb 2003
Posts: 81
Location: Grenaa, Denmark

PostPosted: Wed Mar 19, 2003 1:11 pm    Post subject: Reply with quote

It depends on your compiler.

You should set the subsystem to "windows" instead of "console"

With MinGW (GCC for Win32) you could link with this parameter:
Code:

-mwindows


With MSVC++ you could paste these lines:
Code:

//#pragma comment(linker, "/subsystem:\"console\" /entry:\"mainCRTStartup\"")
#pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"")

_________________
http://www.dotnetforum.dk/blogs/soren.olesen/
Back to top
View user's profile Send private message
soreno
Junior Member
Junior Member


Joined: 13 Feb 2003
Posts: 81
Location: Grenaa, Denmark

PostPosted: Wed Mar 19, 2003 1:13 pm    Post subject: Reply with quote

You can still use
Code:

int main(int argc, char **argv)


when setting subsystem to "windows".
_________________
http://www.dotnetforum.dk/blogs/soren.olesen/
Back to top
View user's profile Send private message
JackFoo
Senior Member
Senior Member


Joined: 05 Feb 2003
Posts: 373
Location: ERROR

PostPosted: Wed Mar 19, 2003 1:41 pm    Post subject: Reply with quote

So simple, damn, I'm deeply vexed. Thanks a lot soreno, -mwindows worked like a charm!!!!

Cheers.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> Plugins and addons: devel.+support (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group