If you want to change the default printer of Windows, you must change the device key in Windows Win.ini. Send a WM_WININICHANGE message:
Var strini: array [0..max_path] of char; arrwindows: array [0..64] of char; begin getWindowsDirectory; strcat (strcat (strcat (strcat (strcat); with tinifi .Create (STRINI) Do Try WriteString ('Windows', 'Device', 'HP LaserJet 4 Plus, HPPCL5MS, LPT1:'); FINALLY FREE;
Strcopy (arrwindows, 'windows'); sendMessage (hwnd_broadcast, wm_wininichange, 0, longint (@arrwindows));