Hi!
On Wed, Jul 1, 2009 at 5:10 PM, Gedgedmurphy@gmail.com wrote:
Did you read this patch before committing it? Your last patch fixed tchar usage and then this next patch introduces new ones.
Looks okay, interesting way for setting up the system menu for kernel space. Need to test this with every application in our test library to make sure this all works!
@@ -1103,8 +1167,30 @@ NTSTATUS WINAPI User32LoadSysMenuTemplateForKernel(PVOID Arguments, ULONG ArgumentLength) {
- LRESULT Result;
- Result = (LRESULT)LoadMenuW(User32Instance, L"SYSMENU");
- HMENU hmenu = LoadMenuW(User32Instance, L"SYSMENU");
- LRESULT Result = (LRESULT)hmenu;
- // removing space for checkboxes from menu
- MENUINFO menuinfo = {0};
- menuinfo.cbSize = sizeof(menuinfo);
- menuinfo.fMask = MIM_STYLE;
- GetMenuInfo(hmenu, &menuinfo);
- menuinfo.dwStyle |= MNS_NOCHECK;
- SetMenuInfo(hmenu, &menuinfo);
- // adding bitmaps to menu items
- MENUITEMINFOW info = {0};
- info.cbSize = sizeof(info);
- info.fMask |= MIIM_BITMAP;
- info.hbmpItem = HBMMENU_POPUP_MINIMIZE;
- SetMenuItemInfoW(hmenu, SC_MINIMIZE, FALSE, &info);
- info.hbmpItem = HBMMENU_POPUP_RESTORE;
- SetMenuItemInfoW(hmenu, SC_RESTORE, FALSE, &info);
- info.hbmpItem = HBMMENU_POPUP_MAXIMIZE;
- SetMenuItemInfoW(hmenu, SC_MAXIMIZE, FALSE, &info);
- info.hbmpItem = HBMMENU_POPUP_CLOSE;
- SetMenuItemInfoW(hmenu, SC_CLOSE, FALSE, &info);
- return(ZwCallbackReturn(&Result, sizeof(LRESULT), STATUS_SUCCESS));
}