Good Morning,

For the last few weeks I've been searching HIGH AND LOW. All forms, dozens of tabs open, and bought about 200 bucks in books. My goal is to learn the windows win32 API and I'm hitting brick walls everywhere I look. So far, I've learned that findwindow (or calls from user32.dll) can be accessed from winuser.h and I'm having a DIFFICULT TIME learning how to get around with the API calls. I'm okay with VB6 / VB 2010 but this, I want to rip my eyes out, freeze them put them in a sock and beat microsoft employees to death with them. I've played with code such as: 



#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <winuser.h>

int main()
{
    HWND hWnd;
    hWnd = FindWindow("CalcFrame", NULL);

    if ( hWnd != 1)
    {
        printf("Window is closed\n"); 
    } else {
        printf("The window is open!\n"); 
    }

    return 0; 
    }


However, NOTHING is working! Maybe there is a resource online for C API calls in windows? Maybe there is a book? Please I need something. I should also mention that **I AM NOT** using .NET. and I'm using Dev-C++ and NetBeans (which I'm leaning more towards NetBeans). Someone, PLEASE HELP!!! 

Thank you, 

amvx86.

Frankly, if I was going to write Win32 Apps I'd head straight to Visual Studio. Since there are free versions for C++ and C# there's not much reason to deal with getting other dev systems to work. Yes, there are some that abhor all things Microsoft but here you are trying to make Windows apps so use the tools I see folk use.

About learning the Win32 API. That's a lifetime topic. My view has been to only use the Win32 API when nothing else will do.

What @rproffitt says, however in your case you do need the Windows API for this. What happens? Does it just hang, or does it give the negative answer? Also, what compiler are you using, MS's visual C compiler? Some other compiler that supports the win32 API? Nevermind. I see you are using Dev-C++ which is a non-MS IDE, and by default uses TDM-GCC, a version of the Gnu compiler suite. As rproffitt said, try the MS Visual Studio compiler. It should have no problem with your .C or .CPP/.CC files.

Edited 8 Months Ago by rubberman

This article has been dead for over six months. Start a new discussion instead.