Get windows and system path with Delphi

Source: Internet
Author: User

The WINDOWSAPI function allows you to obtain the path to Windows and the system. In many programs need to let the program identify the system path before doing other work.

Procedure TForm1.Button1ClickSenderTObject
 var
  SysDirarray0..255of char
 begin
  //获取Windows路径
  GetWindowsDirectorySysDir255
  Edit1.Text=SysDir
  //获取系统路径
  GetSystemDirectorySysDir255
  Edit2.Text=SysDir
end

The following function FindWindow is used to hide and display the Windows taskbar.

Procedure TForm1.Button1ClickSenderTObject
 var
  WndHandleTHandle
 begin
  //获取任务栏的窗口句柄
  WndHandle=FindWindow'Shell_TrayWnd'nil
  ShowWindowWndHandleSW_SHOW//显示任务栏
end
procedure TForm1.Button2ClickSenderTObject
 var
  wndHandleTHandle
 begin
  WndHandle=FindWindow'Shell_TrayWnd'nil
  ShowWindowWndHandleSW_HIDE//隐藏任务栏
end

Above in Win98 and DELPHI6 debugging pass.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.