case WM_SETTINGCHANGE:
hMenu = GetSubMenu (GetMenu (hwnd), 0) ;
while (GetMenuItemCount (hMenu) > 1)
DeleteMenu (hMenu, 1, MF_BYPOSITION) ; // Get a list of all local and remote printers
//
// First, find out how large an array we need; this
// call will fail, leaving the required size in dwNeeded
//
// Next, allocate space for the info array and fill it
//
// Put the printer names on the menu.
EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 5, NULL,
0, &dwNeeded, &dwReturned) ;
pinfo5 = malloc (dwNeeded) ;
EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 5, (PBYTE) pinfo5,
dwNeeded, &dwNeeded, &dwReturned) ;
for (i = 0 ; i < dwReturned ; i++)
{
AppendMenu (hMenu, (i+1) % 16 ? 0 : MF_MENUBARBREAK, i + 1,
pinfo5.pPrinterName) ;
}
free (pinfo5) ;
AppendMenu (hMenu, MF_SEPARATOR, 0, NULL) ;
AppendMenu (hMenu, 0, IDM_DEVMODE, TEXT ("Properties")) ;
[i]wParam = IDM_SCREEN ;//在这设置wParam有什么作用?
hMenu = GetSubMenu (GetMenu (hwnd), 0) ;
while (GetMenuItemCount (hMenu) > 1)
DeleteMenu (hMenu, 1, MF_BYPOSITION) ; // Get a list of all local and remote printers
//
// First, find out how large an array we need; this
// call will fail, leaving the required size in dwNeeded
//
// Next, allocate space for the info array and fill it
//
// Put the printer names on the menu.
EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 5, NULL,
0, &dwNeeded, &dwReturned) ;
pinfo5 = malloc (dwNeeded) ;
EnumPrinters (PRINTER_ENUM_LOCAL, NULL, 5, (PBYTE) pinfo5,
dwNeeded, &dwNeeded, &dwReturned) ;
for (i = 0 ; i < dwReturned ; i++)
{
AppendMenu (hMenu, (i+1) % 16 ? 0 : MF_MENUBARBREAK, i + 1,
pinfo5.pPrinterName) ;
}
free (pinfo5) ;
AppendMenu (hMenu, MF_SEPARATOR, 0, NULL) ;
AppendMenu (hMenu, 0, IDM_DEVMODE, TEXT ("Properties")) ;
[i]wParam = IDM_SCREEN ;//在这设置wParam有什么作用?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货