| View previous topic :: View next topic |
| Author |
Message |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sun Sep 07, 2008 9:58 pm Post subject: [C++] int main + win32 api's, what option? |
|
|
What option/property/preference do you change in MSVC++ to start with , yet be able to use win32api's inside?
example:
| Code: |
#include "windows.h"
#include <iostream>
using namespace std;
int main() {
while (true) {
HWND hWnd;
hWnd = FindWindow(NULL,"MapleStory");
PostMessage(hWnd,WM_CHAR,0x41,1);
Sleep(1);
}
} |
_________________
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Sep 07, 2008 10:16 pm Post subject: |
|
|
| yes, you can use the Win32 API in console programs.
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sun Sep 07, 2008 10:46 pm Post subject: |
|
|
Can you use int main() in win32 apps is what I'm asking i guess
like....
Win32 Project:
| Code: | #include <windows.h>
int main()
{
MessageBox(NULL, "Goodbye, cruel world!", "Note", MB_OK);
return 0;
} |
_________________
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Sun Sep 07, 2008 11:28 pm Post subject: |
|
|
Obviously, what else did you plan on doing?
and you are getting mixed up. That's just a console application, and yes you can use the API in it.
|
|
| Back to top |
|
 |
BanMe Master Cheater
Reputation: 0
Joined: 29 Nov 2005 Posts: 375 Location: Farmington NH, USA
|
Posted: Mon Sep 08, 2008 1:29 am Post subject: |
|
|
the only piece of info here left out is that if you do use User32 API's from a console programm Current Execution thread is marks it as a Win32_GUI_THREAD registering the Service Shadow Descriptor Table to tHe Thread
|
|
| Back to top |
|
 |
|