Changeset View
Changeset View
Standalone View
Standalone View
w32/main.c
Context not available. | |||||
#include <config.h> | #include <config.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <unistd.h> | |||||
#if WINVER < 0x0403 | #if WINVER < 0x0403 | ||||
# define WINVER 0x0403 /* Required for SendInput. */ | # define WINVER 0x0403 /* Required for SendInput. */ | ||||
#endif | #endif | ||||
Context not available. | |||||
#endif | #endif | ||||
/* This function pointer gets initialized in main. */ | /* Currently unused. | ||||
#ifndef HAVE_W32CE_SYSTEM | This function pointer gets initialized in main. */ | ||||
/* #ifndef HAVE_W32CE_SYSTEM | |||||
static BOOL WINAPI (*lock_set_foreground_window)(UINT); | static BOOL WINAPI (*lock_set_foreground_window)(UINT); | ||||
#endif | #endif */ | ||||
static int w32_cmd_handler (pinentry_t pe); | static int w32_cmd_handler (pinentry_t pe); | ||||
static void ok_button_clicked (HWND dlg, pinentry_t pe); | static void ok_button_clicked (HWND dlg, pinentry_t pe); | ||||
Context not available. | |||||
} | } | ||||
/* Somehow this unfocuses the window | |||||
static void | static void | ||||
move_mouse_and_click (HWND hwnd) | move_mouse_and_click (HWND hwnd) | ||||
{ | { | ||||
Context not available. | |||||
if ( (SendInput (idx, inp, sizeof (INPUT)) != idx) && debugfp) | if ( (SendInput (idx, inp, sizeof (INPUT)) != idx) && debugfp) | ||||
fprintf (debugfp, "SendInput failed: %s\n", w32_strerror (-1)); | fprintf (debugfp, "SendInput failed: %s\n", w32_strerror (-1)); | ||||
#endif | #endif | ||||
} | } */ | ||||
Context not available. | |||||
if (!hwnd) | if (!hwnd) | ||||
return; | return; | ||||
(void)string; | |||||
/* FIXME: Need to figure out how to convert dialog coorddnates to | /* FIXME: Need to figure out how to convert dialog coorddnates to | ||||
screen coordinates and how buttons should be placed. */ | screen coordinates and how buttons should be placed. */ | ||||
/* SetWindowPos (hbutton, NULL, */ | /* SetWindowPos (hbutton, NULL, */ | ||||
Context not available. | |||||
/* Dialog processing loop. */ | /* Dialog processing loop. */ | ||||
static BOOL CALLBACK | static INT_PTR CALLBACK | ||||
dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) | dlg_proc (HWND dlg, UINT msg, WPARAM wparam, LPARAM lparam) | ||||
{ | { | ||||
static pinentry_t pe; | static pinentry_t pe; | ||||
Context not available. | |||||
/* show_window_hierarchy (GetDesktopWindow (), 0); */ | /* show_window_hierarchy (GetDesktopWindow (), 0); */ | ||||
ShowWindow (dlg, SW_SHOW); | ShowWindow (dlg, SW_SHOW); | ||||
move_mouse_and_click ( GetDlgItem (dlg, IDC_PINENT_PROMPT) ); | /* Somehow this unfocuses the window: */ | ||||
/* move_mouse_and_click ( GetDlgItem (dlg, IDC_PINENT_PROMPT) ); */ | |||||
raise_sip (dlg); | raise_sip (dlg); | ||||
break; | break; | ||||
Context not available. | |||||
int | int | ||||
main (int argc, char **argv) | main (int argc, char **argv) | ||||
{ | { | ||||
/* Currently unused. | |||||
#ifndef HAVE_W32CE_SYSTEM | #ifndef HAVE_W32CE_SYSTEM | ||||
void *handle; | void *handle; | ||||
#endif | #endif */ | ||||
w32_infd = STDIN_FILENO; | w32_infd = STDIN_FILENO; | ||||
w32_outfd = STDOUT_FILENO; | w32_outfd = STDOUT_FILENO; | ||||
Context not available. | |||||
/* if (!debugfp) */ | /* if (!debugfp) */ | ||||
/* debugfp = stderr; */ | /* debugfp = stderr; */ | ||||
/* We need to load a function because that one is only available | /* Currently unused. | ||||
We need to load a function because that one is only available | |||||
since W2000 but not in older NTs. */ | since W2000 but not in older NTs. */ | ||||
#ifndef HAVE_W32CE_SYSTEM | /* #ifndef HAVE_W32CE_SYSTEM | ||||
handle = LoadLibrary ("user32.dll"); | handle = LoadLibrary ("user32.dll"); | ||||
if (handle) | if (handle) | ||||
{ | { | ||||
Context not available. | |||||
else | else | ||||
CloseHandle (handle); | CloseHandle (handle); | ||||
} | } | ||||
#endif | #endif */ | ||||
if (pinentry_loop2 (w32_infd, w32_outfd)) | if (pinentry_loop2 (w32_infd, w32_outfd)) | ||||
return 1; | return 1; | ||||
Context not available. |