[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Mldonkey-commits] Changes to mldonkey/src/utils/lib/stubs_c.c
From: |
mldonkey-commits |
Subject: |
[Mldonkey-commits] Changes to mldonkey/src/utils/lib/stubs_c.c |
Date: |
Sun, 28 Aug 2005 07:09:17 -0400 |
Index: mldonkey/src/utils/lib/stubs_c.c
diff -u mldonkey/src/utils/lib/stubs_c.c:1.19
mldonkey/src/utils/lib/stubs_c.c:1.20
--- mldonkey/src/utils/lib/stubs_c.c:1.19 Sun Aug 28 11:01:29 2005
+++ mldonkey/src/utils/lib/stubs_c.c Sun Aug 28 11:09:14 2005
@@ -1139,10 +1139,28 @@
#endif /* defined(__MINGW32__) */
+#if defined(__MINGW32__)
+static HWND myHWND = NULL;
+#endif
+
value
-external_start (void)
+external_start (value version)
{
+// Disable close button on console
+#if defined(__MINGW32__)
+ char *buf = "[MLDonkey TitleSearch]\0"; // if multiple instances
+ char *title = String_val (version);
+ SetConsoleTitle((LPCTSTR)buf);
+ myHWND = FindWindowEx(NULL, NULL, NULL, (LPCTSTR)buf);
+ SetConsoleTitle((LPCTSTR)title);
+
+ if (myHWND != NULL) {
+ HMENU hmenu = GetSystemMenu(myHWND, FALSE);
+ DeleteMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
+ }
+#endif
+
#if defined(HAVE_PTHREAD) && defined(PTW32_STATIC_LIB)
pthread_win32_process_attach_np();
#endif
@@ -1153,6 +1171,13 @@
value
external_exit (void)
{
+// Revert console system menu
+#if defined(__MINGW32__)
+ if (myHWND != NULL) {
+ HMENU hmenu = GetSystemMenu(myHWND, TRUE);
+ DrawMenuBar(myHWND);
+ }
+#endif
#if defined(HAVE_PTHREAD) && defined(PTW32_STATIC_LIB)
pthread_win32_process_detach_np();
@@ -1160,4 +1185,3 @@
return Val_unit;
}
-