2
* w32tools.h -- Windows NT specific functions declarations
4
* w32tools.h is a part of binkd project
6
* Copyright (c) 2003 by Stas Degteff g@grumbler.org 2:5080/102@fidonet
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU General Public License as published by
10
* the Free Software Foundation; either version 2 of the License, or
11
* (at your option) any later version. See COPYING.
15
* $Id: w32tools.h,v 2.12 2012/01/23 18:10:57 gul Exp $
18
* $Log: w32tools.h,v $
19
* Revision 2.12 2012/01/23 18:10:57 gul
20
* Fixed declaration of binkd_main() (no 3rd param)
22
* Revision 2.11 2004/01/04 16:55:00 stas
23
* Move declarations of the 'binkd_main' into one place (nt/w32tools.h)
25
* Revision 2.10 2004/01/03 19:04:20 stas
26
* New functions: public w32Init() and hidden w32exitfunc()
28
* Revision 2.9 2004/01/03 18:14:41 stas
29
* Two macroses: IsNTService and Is9xService
31
* Revision 2.8 2004/01/03 12:17:44 stas
32
* Implement full icon support (winNT/2k/XP)
34
* Revision 2.7 2004/01/02 21:20:17 stas
35
* GetMainWindow(): function retrieves the window handle used by the main window of application
37
* Revision 2.6 2003/10/28 20:20:10 stas
38
* Rewrite NT service code, remove obsoleted code and add some checks. Found a thread-not-safety problem.
40
* Revision 2.5 2003/10/18 18:50:48 stas
41
* Move to new 'tray.c' file several functions when is related with 'minimize to tray' feature
43
* Revision 2.4 2003/08/21 15:40:35 gul
44
* Change building commandline for service under win32
45
* (patch by Alexander Reznikov)
47
* Revision 2.3 2003/08/04 12:23:40 gul
55
#define AlertWin(text) MessageBox(NULL, text, MYNAME, MB_OK|MB_ICONSTOP|0x00200000L|MB_SYSTEMMODAL|MB_SETFOREGROUND)
57
/* Declaration of main binkd function (see binkd.c) */
58
int binkd_main(int argc, char **argv);
60
#define IsNTService (IsNT()&&isService())
61
#define Is9xService (Is9x()&&isService())
63
/* Test on Windows 95/98/Me
65
(This is call to W32_CheckOS())
69
/* Test on Windows NT/2000/XP/2003
71
(This is call to W32_CheckOS())
75
/* Windows version test
76
* Parameter: Platform ID (VER_PLATFORM_WIN32_NT, VER_PLATFORM_WIN32_WINDOWS
77
* or other, see GetVersionEx() if MSDN)
78
* Return 0 if match OS, not zero (usually -1) if do not match OS,
79
* return 1 if can't retrieve OS version info.
81
int W32_CheckOS(unsigned long PlatformId);
83
/* Return service name (retrieve from installed service or replace spaces with underscores)
84
Parameter is "service display name"
85
Based on get_service_name() from Apache sources (c) The Apache Software Foundation.
87
char *get_service_name(char *display_name);
89
/* Build service arguments list
90
* Parameters: asp - new arguments list
91
* argv - old arguments list in *argv[] format
92
* use_argv0 - use argv[0] or GetModuleFileName()
93
* Function add two '\0' to indicate end of array.
96
int build_service_arguments(char **asp, char *argv[], int use_argv0);
99
/**************************************************************************
100
* Determine if we're running as a service. Return 0 if binkd running not *
101
* as a service. Universal: any 32-bit version of Windows. *
103
* Windows NT/2000/XP/2003: a hack to determine if we're running *
104
* as a service without waiting for the SCM to fail. *
105
* (Idea taken from Apache sources) *
106
* Windows 9x/Me: service indicated via undocumented command line option *
110
/**************************************************************************
111
* The GetMainWindow function retrieves the window handle used by the main
114
HWND GetMainWindow(void);
118
HICON LoadBinkdIcon(void);
122
void UnloadBinkdIcon(void);
124
/* Startup actions for win32 and win9x versions of binkd