Skip to content

Commit

Permalink
List all windows on the system. (Commented out)
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleyd committed Nov 26, 2009
1 parent 6c88d47 commit 601a25a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions pageant.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,25 @@ print_buf(int level, byte *buf, int numbytes)
}
}

BOOL CALLBACK
wnd_enum_proc(HWND hwnd, LPARAM lparam)
{
char window_name[512] = "\0";
GetWindowText(hwnd, window_name, 512);
EPRINTF(0, "Window %p: title '%s'.\n", hwnd, window_name);
return TRUE;
}

void
enum_windows(void)
{
BOOL retval = EnumWindows(wnd_enum_proc, (LPARAM) 0);

if (!retval) {
EPRINTF(0, "EnumWindows failed; GetLastError() => %d.\n",
(int) GetLastError());
}
}

// "in" means "to pageant", "out" means "from pageant". Sorry.
int
Expand Down Expand Up @@ -97,6 +115,9 @@ send_request_to_pageant(byte *inbuf, int inbytes, byte *outbuf, int outbuflen)
return 0;
}

// enum_windows();


UnmapViewOfFile(shmem);
CloseHandle(filemap);

Expand Down

0 comments on commit 601a25a

Please sign in to comment.