Skip to content

Commit 7a0b363

Browse files
authored
Add files via upload
1 parent 18c3697 commit 7a0b363

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

src/viv.c

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static void _viv_command_with_is_key_repeat(int command,int is_key_repeat);
373373
static void _viv_command(int command);
374374
static int _viv_process_install_command_line_options(wchar_t *cl);
375375
static void _viv_process_command_line(wchar_t *cl);
376-
static int _viv_init(void);
376+
static int _viv_init(int nCmdShow);
377377
static void _viv_kill(void);
378378
static void _viv_exit(void);
379379
static int _viv_next(int prev,int reset_slideshow_timer,int is_preload,int allow_image_skip);
@@ -547,6 +547,7 @@ static void _viv_hide_cursor(void);
547547
static int _viv_should_show_cursor(void);
548548
static void _viv_update_show_cursor(void);
549549
static void _viv_start_hide_cursor_timer(void);
550+
static int _viv_main(int nCmdShow);
550551

551552
static HMODULE _viv_stobject_hmodule = 0;
552553
static _viv_playlist_t *_viv_playlist_start = 0;
@@ -4794,7 +4795,7 @@ static void _viv_process_command_line(wchar_t *cl)
47944795
}
47954796
}
47964797

4797-
static int _viv_init(void)
4798+
static int _viv_init(int nCmdShow)
47984799
{
47994800
RECT rect;
48004801
STARTUPINFO si;
@@ -4951,6 +4952,11 @@ static int _viv_init(void)
49514952
si.cb = sizeof(STARTUPINFO);
49524953
GetStartupInfo(&si);
49534954

4955+
if (!(si.dwFlags & STARTF_USESHOWWINDOW))
4956+
{
4957+
si.wShowWindow = nCmdShow;
4958+
}
4959+
49544960
// calc size
49554961
size = sizeof(DWORD) + (((int)string_length(command_line) + 1) * sizeof(wchar_t)) + (((int)string_length(cwd) + 1) * sizeof(wchar_t));
49564962
buf = (char *)mem_alloc(size);
@@ -5036,6 +5042,11 @@ static int _viv_init(void)
50365042

50375043
si.cb = sizeof(STARTUPINFO);
50385044
GetStartupInfo(&si);
5045+
5046+
if (!(si.dwFlags & STARTF_USESHOWWINDOW))
5047+
{
5048+
si.wShowWindow = nCmdShow;
5049+
}
50395050

50405051
// default is to shownormal.
50415052
// if its anything else, like minimize/maximize to that before we apply the command line.
@@ -5182,9 +5193,9 @@ static void _viv_kill(void)
51825193
#endif
51835194
}
51845195

5185-
static int _viv_main(void)
5196+
static int _viv_main(int nCmdShow)
51865197
{
5187-
if (_viv_init())
5198+
if (_viv_init(nCmdShow))
51885199
{
51895200
for(;;)
51905201
{
@@ -5219,12 +5230,12 @@ static int _viv_main(void)
52195230

52205231
int APIENTRY WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
52215232
{
5222-
return _viv_main();
5233+
return _viv_main(nShowCmd);
52235234
}
52245235

52255236
int __cdecl main(int argc,char **argv)
52265237
{
5227-
return _viv_main();
5238+
return _viv_main(SW_SHOW);
52285239
}
52295240

52305241
static int _viv_compare_id(const WIN32_FIND_DATA *a,const WIN32_FIND_DATA *b)

0 commit comments

Comments
 (0)