Results 1 to 3 of 3

Thread: Win Api

  1. #1
    zchoyt
    Guest

    Win Api

    Can someone tell me why these two programs both get the same type of error:
    "error C2146: syntax error : missing ';' before identifier 'Internal'"
    PHP Code:
    #include "stdafx.h"
    #include <winbase.h>

    void CCCD_Example();


    int main(int argccharargv[])
    {
        return 
    0;
    }

    void CCCD_Example()
    {
        
    HANDLE hnd;

        
    //Creates a text document on the root
        
    hnd CreateFile("C:\\anew.txt"GENERIC_WRITEFILE_SHARE_WRITE0CREATE_NEWFILE_ATTRIBUTE_NORMAL0);

        
    //Closes handle returned from CreateFile
        
    CloseHandle(hnd);

        
    //Copies the newly created file to the desktop
        
    CopyFile("C:\\anew.txt""C:\\WINDOWS\\Desktop\\anew2.txt"false);

        
    //Goes back and deletes the first file on root C
        
    DeleteFile("C:\\anew.txt");



    and this one gets:
    syntax error : missing ';' before identifier 'HDWP'
    PHP Code:
    #include "stdafx.h"
    #include <winuser.h>
    using namespace std;


    void LockDesk();


    int main(int argccharargv[])
    {
        
    LockDesk();
        return 
    0;
    }


    void LockDesk()
    {
        
    HWND WinHandle 0;

        
    //Locks the handle of the desktop   
        
    LockWindowUpdateGetDesktopWindow());

        
    //Releases the desktop lock
        
    LockWindowUpdate(Null);


    If am not sure if I am making the same mistake over and over again or what?

  2. #2
    Zaei
    Guest
    Try just #include-ing <windows.h>

    Z.

  3. #3
    zchoyt
    Guest
    Yes. You are correct. I just figured it out a second ago. I love you man!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width