icons in system tray ...

can i find somewhere in system, wich dll or other method is called by clicking on the icon in systemtray?

inthe has a good advice:
by clicking on system-hours is called dll, what can i simulate in delphi with this code:
  WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0'),SW_SHOWNORMAL);

is something in this style for keyboard switching too?
pistacerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
intheConnect With a Mentor Commented:
also found this:

http://www.geocities.com/SiliconValley/Lakes/1636/layout.htm

Regards Barry
ps
this is much for 30 points ;-))
0
 
intheCommented:
hi
can you explain more as im not sure i understand the question properly.
0
 
pistacerAuthor Commented:
well inthe, if i use the piece of code, that is wroten below, it'll run the functionality, as if i has click on the system hours.
Wich piece of code will simulate clicking on icon for keyboard change?

where to find such an information?
0
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

 
intheCommented:
ok i think i understand:

command:

WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL main.cpl @1'),SW_SHOWNORMAL);

       displays Keyboard Properties, Speed tab
 
command:

WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,1'),SW_SHOWNORMAL);

         displays Keyboard Properties, Language tab


command:

WinExec(PChar('rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,2'),SW_SHOWNORMAL);

          displays Keyboard Properties, General tab



is this the information you wanted?
if you want i can paste a complete list of the commands of the control panel applets,just say if thats what you after.
Regards Barry
0
 
pistacerAuthor Commented:
well, that is nice, but i think on something else. Commands you pasted are similar to right-click on keyboard_switch icon in system tray (icon with two letters identifying the language) and then choosing properties from the popup menu.

what i seek is the left_click on it. It shows a simple popup menu (by me it consists of two lines - english and slovak) where i can quick choose the keyboard i want to use.

(... and yes, if you would be so nice and put here some other commands of the control panel, ... ewery knowledge is good ... or better i will create a special question on that)
0
 
intheCommented:
now i see ;-)

you want to change the keyboard layout by code. for that you need the loadkeyboardlayout() and ,activatekeyboardlayout() api calls ..
here is an example form a book i have:

unit LoadKeyboardLayoutU;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, Spin, ComCtrls, Tabnotbk, ExtCtrls, Math;

const MAX_HKL = 5;

type
  TForm1 = class(TForm)
    Button1: TButton;
    TabbedNotebook1: TTabbedNotebook;
    ListBox1: TListBox;
    Button2: TButton;
    StatusBar1: TStatusBar;
    Button3: TButton;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Edit2: TEdit;
    Button4: TButton;
    Label3: TLabel;
    StaticText1: TStaticText;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

  function MakeLangID(PrimLang, SubLang:WORD): WORD;

var
  Form1: TForm1;
  List : array [0..MAX_HKL] of HKL;    // list of keyboard handles

implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
  MyLangID: WORD;  // holds a language identifier
begin
  {load the keyboard layout specified by language IDs}
  MyLangID:=MakeLangID(WORD(StrToInt(Edit1.Text)), WORD(StrToInt(Edit2.Text)));
  if LoadKeyBoardLayout(PChar('0000' + IntToHex(MyLangID,4)),KLF_ACTIVATE) = 0
  then ShowMessage('Error loading keyboard layout');
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  {activate the highlighted keyboard layout}
  if (ActivateKeyboardLayout(StrToInt(ListBox1.Items[Listbox1.Itemindex]),
      KLF_REORDER) = 0) then
    ShowMessage('Error activating the keyboard layout');

  {clear the keyboard layout list and repopulate it}
  ListBox1.Clear;
  FormCreate(Sender);
end;

procedure TForm1.FormCreate(Sender: TObject);
var
  pwszKLID: PChar;          // holds the name of a keyboard layout
  MyListIndex: Integer;     // specifies a list index
begin
  {get the keyboard layout lists}
  GetKeyboardLayoutList(MAX_HKL, List);

  {allocate a buffer for the keyboard layout name string}
  GetMem(pwszKLID, KL_NAMELENGTH);

  {retrieve the name string for active keyboard layout}
  GetKeyboardLayoutName(pwszKLID);
  ShowMessage('The active keyboard layout is '+pwszKLID);
  StatusBar1.SimpleText:= 'Active keyboard layout ' +  pwszKLID;

  {retrive the code page identifier}
  StaticText1.Caption:=IntTostr(GetACP);

  {free the string memory}
  FreeMem(pwszKLID);

  {list all the keyboard layout in the list box}
  MyListIndex := 0;
  While (List[MyListIndex] <> 0) do
  begin
    ListBox1.Items.Add(IntToStr(List[MyListIndex]));
    Inc(MyListIndex);
  end;
end;

procedure TForm1.Button3Click(Sender: TObject);
begin
  {unload keyboard layout}
  if not UnLoadKeyboardLayout(StrToInt(ListBox1.Items[Listbox1.ItemIndex])) then
    ShowMessage('Error Unloading Keyboard Layout');
end;

function MakeLangID(PrimLang, SubLang:WORD): WORD;
begin
  {make a Language ID by combining the Primary language ID and Sub language ID}
  Result := (SubLang SHL 10) + PrimLang;
end;

procedure TForm1.Button4Click(Sender: TObject);
begin
  Close;
end;

end.




form view as text :

object Form1: TForm1
  Left = 262
  Top = 114
  BorderStyle = bsDialog
  Caption = 'LoadKeyboardLayout Example'
  ClientHeight = 310
  ClientWidth = 397
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  Position = poScreenCenter
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Button1: TButton
    Left = 264
    Top = 200
    Width = 131
    Height = 17
    Caption = 'Load'
    TabOrder = 0
    OnClick = Button1Click
  end
  object TabbedNotebook1: TTabbedNotebook
    Left = 0
    Top = 0
    Width = 393
    Height = 185
    TabFont.Charset = DEFAULT_CHARSET
    TabFont.Color = clBtnText
    TabFont.Height = -11
    TabFont.Name = 'MS Sans Serif'
    TabFont.Style = []
    TabOrder = 1
    object TTabPage
      Left = 4
      Top = 24
      Caption = 'Keyboard layout'
      object ListBox1: TListBox
        Left = 0
        Top = 0
        Width = 385
        Height = 157
        Align = alClient
        Columns = 2
        ItemHeight = 13
        TabOrder = 0
      end
    end
  end
  object Button2: TButton
    Left = 264
    Top = 216
    Width = 131
    Height = 17
    Caption = 'Activate'
    TabOrder = 2
    OnClick = Button2Click
  end
  object StatusBar1: TStatusBar
    Left = 0
    Top = 291
    Width = 397
    Height = 19
    Panels = <>
    SimplePanel = True
    SizeGrip = False
  end
  object Button3: TButton
    Left = 264
    Top = 232
    Width = 131
    Height = 17
    Caption = 'UnLoad'
    TabOrder = 4
    OnClick = Button3Click
  end
  object Panel1: TPanel
    Left = 0
    Top = 192
    Width = 249
    Height = 89
    BevelInner = bvRaised
    BevelOuter = bvLowered
    TabOrder = 5
    object Label1: TLabel
      Left = 41
      Top = 16
      Width = 102
      Height = 13
      Alignment = taRightJustify
      Caption = 'Primary Language ID:'
    end
    object Label2: TLabel
      Left = 32
      Top = 32
      Width = 113
      Height = 13
      Alignment = taRightJustify
      Caption = 'Secondry Language ID:'
    end
    object Label3: TLabel
      Left = 16
      Top = 64
      Width = 123
      Height = 13
      Caption = 'OEM code page identifier:'
    end
    object Edit1: TEdit
      Left = 144
      Top = 16
      Width = 81
      Height = 19
      Ctl3D = False
      ParentCtl3D = False
      TabOrder = 0
    end
    object Edit2: TEdit
      Left = 144
      Top = 32
      Width = 81
      Height = 19
      Ctl3D = False
      ParentCtl3D = False
      TabOrder = 1
    end
    object StaticText1: TStaticText
      Left = 148
      Top = 64
      Width = 4
      Height = 4
      TabOrder = 2
    end
  end
  object Button4: TButton
    Left = 264
    Top = 248
    Width = 131
    Height = 17
    Caption = 'E&xit'
    TabOrder = 6
    OnClick = Button4Click
  end
end
 

0
 
intheCommented:
if you want see win32.hlp file for a proper description of the calls.
about the winexec calls for cpl files(control panel applets)


Control Panel
 
  module:
          CONTROL.EXE
 
command:
          rundll32.exe shell32.dll,Control_RunDLL
    result:
          displays the Control Panel icons in an Explorer view
 
 
Accessibility Properties
 
  module:
          ACCESS.CPL
 
under Win95:
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5
    result:
          displays the Accessibility General properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1
    result:
          displays the Accessibility Keyboard properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2
    result:
          displays the Accessibility Sound properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3
    result:
          displays the Accessibility Display properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4
    result:
          displays the Accessibility Mouse properties
 
 
under NT 4.0
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,0
    -or-
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1
    result:
          displays the Accessibility Keyboard properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2
    result:
          displays the Accessibility Sound properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3
    result:
          displays the Accessibility Mouse properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4
    result:
          displays the Accessibility General properties
 
 
 
Add New Hardware Wizard
 
  module:
          SYSDM.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1
    result:
          runs the Add New Hardware wizard
 
 
 
Add New Printer Wizard
 
  module:
        SHELL32.DLL
 
command:
        rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter     result:
        runs the Add New Printer wizard
 
comments:
        Windows NT, it is possible to bring up a predefined Windows Dialog box for connecting to a network printer - the
        ConnectToPrinterDlg API. Not sure is this will work in Delphi.
 
 
Add/Remove Programs Property Page
 
  module:
          APPWIZ.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,1
    result:
          displays the Install/Uninstall tab selected
 
command:
          rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,2
    result:
          displays the Windows Setup tab selected
 
command:
          rundll32.exe shell32.dll,Control_RunDLL appwiz.cpl,,3
    result:
          displays the Startup Disk tab selected
 
 
 
Copy Disk Dialog
 
  module:
          DISKCOPY.DLL
 
command:
          rundll32.exe diskcopy.dll,DiskCopyRunDll
    result:
          displays the Copy Disk dialog for removable media
 
 
 
Date & Time Properties
 
  module:
          TIMEDATE.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,0     result:
          displays Set Date & Time properties tab
 
command:
          rundll32.exe shell32.dll,Control_RunDLL timedate.cpl,,1     result:
          displays the Time Zone properties tab
 
 
 
Dial Up Networking (DUN)
 
  module:
          RNAUI.DLL
 
command:
          rundll32.exe rnaui.dll,RnaDial {name of connection to
establish}
    result:
          displays the Connect To dialog for the passed connection
 
 
 
Display Options (Standard Windows Display Property Page)
 
  module:
        DESK.CPL
 
command:
        rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,0
    result:
        displays the Background tab selected
 
command:
        rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,1
    result:
        displays the Screen Saver tab selected
 
command:
        rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,2
    result:
        displays the Appearance tab selected
 
command:
        rundll32.exe shell32.dll,Control_RunDLL desk.cpl,,3
    result:
        displays the Settings tab selected
 
comments:
        Note: Your video adapter may install other property pages into DESK.CPL dynamically when selected with its own icon
        (i.e an ATI or Matrox control panel icon). Additionally, it also may invoke its own control panel applet mimicking the
        Windows display options.
 
 
 
Joystick Properties
 
  module:
          JOY.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL joy.cpl
    result:
          displays the Joystick property page
 
 
 
Mail and Fax Options
 
  module:
          MLCFG32.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mlcfg32.cpl
    result:
          displays the Microsoft Exchange Profiles general property page
 
 
 
 
Mail Postoffice Options
 
  module:
          WGPOCPL.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL wgpocpl.cpl
    result:
          displays the Microsoft Postoffice Workgroup Admin property page
 
 
 
Main Group Options/Properties
 
  module:
          MAIN.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @0
    result:
          displays Mouse Properties
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @1
    result:
          displays Keyboard Properties, Speed tab
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,1     result:
          displays Keyboard Properties, Language tab
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @1,,2     result:
          displays Keyboard Properties, General tab
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @2
    result:
          displays the Printers Folder (including Add Printer)
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @3
    result:
          displays the Fonts Folder in Explorer view
 
command:
          rundll32.exe shell32.dll,Control_RunDLL main.cpl @4
    result:
          displays Power Management Properties
 
 
 
Modem
 
  module:
          MODEM.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL modem.cpl,,add     result:
          Runs the Add New Modem wizard
 
 
 
Multimedia & Sound Properties
 
  module:
          MMSYS.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,0
    result:
          displays the Multimedia/Audio property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,1
    result:
          displays the Multimedia/Video property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,2
    result:
          displays the Multimedia/MIDI property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,3
    result:
          displays the Multimedia/CD Music property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl,,4
    result:
          displays the Multimedia/Advanced property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL mmsys.cpl @1
    result:
          displays the Sound Properties page
 
 
 
Network Properties
 
  module:
          NETCPL.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL netcpl.cpl
    result:
          displays the Networks properties, Configuration tab
 
 
 
Open With
 
  module:
        SHELL32.DLL
command:
        rundll32.exe shell32.dll,OpenAs_RunDLL {path\filename}
    result:
        displays the application/file "Open With" dialog
 
    result:
        passing the full file path and name as a parameter will cause the dialog to display the line "Click the program you want
        to use to open the file '{filename}'".
 
 
 
Passwords Properties
 
  module:
          PASSWORD.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL password.cpl
    result:
          displays the Passwords properties, Change Passwords tab
 
 
 
Regional Settings
 
  module:
          INTL.CPL
 
command:
          rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,0
    result:
          displays the Regional Settings property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,1
    result:
          displays the Numbers property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,2
    result:
          displays the Currency property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,3
    result:
          displays the Time property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,4
    result:
          displays the Date property page
 
command:
(NT 4.0)  rundll32.exe shell32.dll,Control_RunDLL intl.cpl,,5
    result:
          displays the Input Locales property page
 
 
Screen Saver Installation
 
  module:
        APPWIZ.CPL
 
command:
        rundll32.exe desk.cpl,InstallScreenSaver c:\win\system\Flying Windows.scr
    result:
        Installs the new screen saver and runs the display/screen saver preview property page
 
comments:
        Specify a valid path to the screen saver file to install. If you are installing a new screen saver, first copy the screen saver         file into the \windows\system folder, then execute the above command. This will install the specified saver as the current
        screen saver. It will not copy the file into the windows\system folder. Replace the string above with the name of your
        actual .scr file.
 
 
 
System Properties
 
  module:
          SYSDM.CPL
 
 
Under Win95:
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0
    result:
          displays the General property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1
    result:
          displays the Device Manager property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2
    result:
          displays the Hardware Profiles property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3
    result:
          displays the Performance property page
 
 
Under NT4.0:
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,0
    result:
          displays the General property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,1
    result:
          displays the Performance property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,2
    result:
          displays the Environment property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,3
    result:
          displays the Startup/Shutdown property page
 
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,4
    result:
          displays the Hardware Profiles property page
 
command:
          rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl,,5
    result:
          displays the user Profiles property page

0
 
pistacerAuthor Commented:
Adjusted points to 45
0
 
pistacerAuthor Commented:
wow! so much!
thank you wery well!
0
All Courses

From novice to tech pro — start learning today.