I used GetWindowLong window api to get current window state of a window in c#.
[DllImport("user32.dll")]
static extern int GetWindowLong(IntPtr hWnd, int nIndex);
Process[] processList = Process.GetProcesses();
foreach (Process theprocess in processList)
{
long windowState = GetWindowLong(theprocess.MainWindowHandle, GWL_STYLE);
MessageBox.Show(windowState.ToString());
}
I expected to get numbers on http://www.autohotkey.com/docs/misc/Styles.htm, but I get numbers like -482344960, -1803550644, and 382554704.
Do I need to convert windowState variable?? if so, to what?
What is weird about those values? For example,
482344960is equivalent to0x1CC00000which looks like something you might expect to see as a window style. Looking at the styles reference you linked to, that isWS_VISIBLE | WS_CAPTION | 0xC000000.If you wanted to test for
WS_VISIBLE, for example, you would do something like: