应该是更改注册表里面系统设置值
WriteProfileString("windows", "Device", DeviceLine)
然后发出WM_WININICHANGE消息,通知系统设置改变
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0,"windows")
WriteProfileString("windows", "Device", DeviceLine)
然后发出WM_WININICHANGE消息,通知系统设置改变
SendMessage(HWND_BROADCAST, WM_WININICHANGE, 0,"windows")
// returned string should be of the form "driver,port,timeout,timeout", i.e. "winspool,LPT1:,15,45".
GetProfileString(TEXT("Windows"),TEXT("Device"),_T(",,,"),m_szName, COUNTOF(m_szName));
WriteProfileString(TEXT("Windows"),TEXT("Device"),pszPrinterName ));
// Notify all open applications of the change. Note, only applications that handle the message will recognize the change.
#if WM_WININICHANGE != WM_SETTINGCHANGE
// Old message type; for windows 95
SendNotifyMessage(HWND_BROADCAST,WM_WININICHANGE,0,(LPARAM)szWindows);
#endif
// New message type
SendNotifyMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,(LPARAM)szWindows);