Mega Code Archive

 
Categories / Delphi / API
 

Is my machine connected to the network

Question: How can my application tell if the machine is connected to a network under Windows 95? Answer: You can call the Windows API function GetSystemMetrics() and pass the SM_NETWORK flag. Example: procedure TForm1.Button1Click(Sender: TObject); begin if GetSystemMetrics(SM_NETWORK) AND $01 = $01 then ShowMessage('Machine is attached to network') else ShowMessage('Machine is not attached to network'); end;