How getting Position of the TaskBar Icons in Windows 11 ?

Just starting out? Need help? Post your questions and find answers here.
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

How getting Position of the TaskBar Icons in Windows 11 ?

Post by AL90 »

Hi,

How i can get the position of the taskbar icons in windows 11 ?
i mean if is left or centered. i hope you can help me. thank you very much. :wink:

Ciao
AL90
breeze4me
Enthusiast
Enthusiast
Posts: 511
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: How getting Position of the TaskBar Icons in Windows 11 ?

Post by breeze4me »

Such information is usually stored in the registry. Therefore, it is easy to know by googling.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
"TaskbarAl" DWORD value
0 = left alignment
1 = center alignment

Code: Select all

;Return value: -1 (error), 0 (left), 1 (center)
Procedure IsTaskBarIconsCenterAligned()
  Protected Value, Result = -1
  Protected Type = #REG_DWORD, Size = 4
  
  If OSVersion() >= #PB_OS_Windows_11
    If SHRegGetUSValue_("Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarAl", @Type, @Value, @Size, 0, 0, 0) = #ERROR_SUCCESS
      Result = Value
    EndIf
  EndIf
  ProcedureReturn Result
EndProcedure

Debug IsTaskBarIconsCenterAligned()

BarryG
Addict
Addict
Posts: 3292
Joined: Thu Apr 18, 2019 8:17 am

Re: How getting Position of the TaskBar Icons in Windows 11 ?

Post by BarryG »

Code: Select all

SHRegGetUSValue_()
Wow, I've never seen that before! Such a short and sweet way to grab a Registry value without using a procedure or module. Thanks!
User avatar
AL90
Enthusiast
Enthusiast
Posts: 217
Joined: Fri Sep 16, 2005 7:47 pm
Location: Germany
Contact:

Re: How getting Position of the TaskBar Icons in Windows 11 ?

Post by AL90 »

breeze4me wrote: Tue Jun 28, 2022 11:35 pm Such information is usually stored in the registry. Therefore, it is easy to know by googling.
Wow that works fine. Many thanky to you! :D
Post Reply