ShowWindow not working

1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include<iostream>
#include "windows.h"

using namespace std;


int main(){
	HWND Win = CreateWindow(NULL,"Test",WS_BORDER|WS_VISIBLE,300,400,800,600,NULL,NULL,NULL,NULL);
	DWORD ID;
	GetWindowThreadProcessId(Win,&ID);
	HANDLE WP = OpenProcess(PROCESS_ALL_ACCESS,0,ID);
	ShowWindow(Win,5);
	return 0;
}
The window is not showing.
WOW :) You are confused, Mr.Cpper.
Programming in Console mode is different than in Windows application. Forget about int main() here, because there is a different WinMain function that has different parameters.
I think you need to read through this tutorial:
http://www.winprog.org/tutorial/

Hey, did you notice that you #included <iostream> without using it? See through the tutorial, if you think you need more skills in Console mode (the terminal/ the command prompt), then you may take it easy on Windows programming.

Good luck :)

Topic archived. No new replies allowed.