Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


is this how to make an APP?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Aug 05, 2007 2:14 am    Post subject: is this how to make an APP? Reply with quote

I'm new to making APPs in C++, so this is the write way to make an app write?

Code:

#include <windows.h>

LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);

char szClassName[ ] = "WindowsApp";

int WINAPI WinMain (HINSTANCE hThisInstance,
                    HINSTANCE hPrevInstance,
                    LPSTR lpszArgument,
                    int nFunsterStil)

{
    HWND hwnd;             
    MSG messages;           
    WNDCLASSEX wincl;       

    wincl.hInstance = hThisInstance;
    wincl.lpszClassName = szClassName;
    wincl.lpfnWndProc = WindowProcedure;     
    wincl.style = CS_DBLCLKS;               
    wincl.cbSize = sizeof (WNDCLASSEX);

    wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
    wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
    wincl.lpszMenuName = NULL;               
    wincl.cbClsExtra = 0;                     
    wincl.cbWndExtra = 0;                   
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;

    if (!RegisterClassEx (&wincl))
        return 0;

    hwnd = CreateWindowEx (
           0,                 
           szClassName,       
           "Windows App",       
           WS_OVERLAPPEDWINDOW,
           CW_USEDEFAULT,     
           CW_USEDEFAULT,       
           544,                 
           375,                 
           HWND_DESKTOP,       
           NULL,               
           hThisInstance,       
           NULL               
           );

    ShowWindow (hwnd, nFunsterStil);

    while (GetMessage (&messages, NULL, 0, 0))
    {
        TranslateMessage(&messages);
        DispatchMessage(&messages);
    }

    return messages.wParam;
}


LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)                 
    {
        case WM_DESTROY:
            PostQuitMessage (0);       queue */
            break;
        default:                     
            return DefWindowProc (hwnd, message, wParam, lParam);
    }

    return 0;
}

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
the_undead
Expert Cheater
Reputation: 1

Joined: 12 Nov 2006
Posts: 235
Location: Johannesburg, South Africa

PostPosted: Sun Aug 05, 2007 3:40 am    Post subject: Reply with quote

Code:
#include <windows.h>

LRESULT CALLBACK WndProc( HWND hWnd , UINT message , WPARAM wParam , LPARAM lParam)
{
    switch(message)
   {
      case WM_CREATE:     
         break;    
      case WM_COMMAND:     
         break;
      case WM_PAINT:
         break;
   }
    return DefWindowProc(hWnd,message,wParam,lParam);
}

INT WINAPI WinMain( HINSTANCE , HINSTANCE , LPSTR , INT )
{
    WNDCLASSEX wc;
    wc.cbClsExtra = 0;
    wc.cbSize = sizeof(wc);
    wc.cbWndExtra = 0;
    wc.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wc.hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW));
    wc.hIcon = LoadIcon(NULL, MAKEINTRESOURCE(IDI_HAND));
    wc.hIconSm = LoadIcon(NULL, MAKEINTRESOURCE(IDI_HAND));
    wc.hInstance = GetModuleHandle(NULL);
    wc.lpfnWndProc = WndProc;
    wc.lpszClassName = "ThisIsMyClass";
    wc.lpszMenuName = NULL;
    wc.style = CS_VREDRAW|CS_HREDRAW|CS_OWNDC;
     
    RegisterClassEx(&wc);

    HWND hWnd = CreateWindowEx(0,
               "ThisIsMyClass","ThisIsMyWindowName",
               WS_VISIBLE|WS_SYSMENU,
               100,100,480,320,
               NULL,NULL,
               wc.hInstance,0); 
     
    ShowWindow(hWnd,SW_SHOW);
     
    MSG msg;
    while(GetMessage(&msg,hWnd,0,0)>0)
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return 0;
}

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Sun Aug 05, 2007 9:13 am    Post subject: Reply with quote

Instead of just giving me the code, can you tell me why you changed what you did and what the difference is.

Edit:

I already know that my way compiles, I just wanted to know if that way is used the most.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Zyph
Grandmaster Cheater
Reputation: 0

Joined: 10 Jan 2007
Posts: 511
Location: fo.writelines(['Mass<\n>',

PostPosted: Sun Aug 05, 2007 5:42 pm    Post subject: Reply with quote

oib111 wrote:
Instead of just giving me the code, can you tell me why you changed what you did and what the difference is.


Yay! Someone wants to learn Very Happy

_________________
WoW = Waiting on Warhammer.

I don't play MapleStory, so don't PM me asking for help with anything.
Back to top
View user's profile Send private message AIM Address
sponge
I'm a spammer
Reputation: 1

Joined: 07 Nov 2006
Posts: 6009

PostPosted: Sun Aug 05, 2007 5:44 pm    Post subject: Reply with quote

Applications don't have to have a GUI to be called an APP. Rolling Eyes
console and "gui-less" (word doesn't come to mind) are still applications.

_________________
Back to top
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Sun Aug 05, 2007 5:58 pm    Post subject: Reply with quote

sponge wrote:
Applications don't have to have a GUI to be called an APP. Rolling Eyes
console and "gui-less" (word doesn't come to mind) are still applications.


Probably because the only thing he did in a console is a "Hello World" program. And now he wants to jump to going GUI without knowing the basics Surprised

_________________
Back to top
View user's profile Send private message
oib111
I post too much
Reputation: 0

Joined: 02 Apr 2007
Posts: 2947
Location: you wanna know why?

PostPosted: Mon Aug 06, 2007 6:01 pm    Post subject: Reply with quote

UnLmtD wrote:
sponge wrote:
Applications don't have to have a GUI to be called an APP. Rolling Eyes
console and "gui-less" (word doesn't come to mind) are still applications.


Probably because the only thing he did in a console is a "Hello World" program. And now he wants to jump to going GUI without knowing the basics Surprised


not true...T.T

And sorry. I will change the title. But still, instead of insulting me by saying what I don't know, and if I didn't really do anything but Hello World, kind help me, and then kindly point it out. Although sponge really did do it kindly.

_________________


8D wrote:

cigs dont make people high, which weed does, which causes them to do bad stuff. like killing
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites