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 argc, char* argv[])
{
return 0;
}
void CCCD_Example()
{
HANDLE hnd;
//Creates a text document on the root
hnd = CreateFile("C:\\anew.txt", GENERIC_WRITE, FILE_SHARE_WRITE, 0, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, 0);
//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 argc, char* argv[])
{
LockDesk();
return 0;
}
void LockDesk()
{
HWND WinHandle = 0;
//Locks the handle of the desktop
LockWindowUpdate( GetDesktopWindow());
//Releases the desktop lock
LockWindowUpdate(Null);
}
If am not sure if I am making the same mistake over and over again or what?


Reply With Quote