Recent

Author Topic: Does anybody know how to display the keyboard SIP icon ?  (Read 6703 times)

swierzbicki

  • Full Member
  • ***
  • Posts: 177
Does anybody know how to display the keyboard SIP icon ?
« on: September 29, 2014, 07:56:37 pm »
Hello,

I'm able to write full screen application on Windows ce 6.5. ( can easily done here http://forum.lazarus.freepascal.org/index.php/topic,25172.0.html )

My only issue is that I not able to display the black SIP icon (see attached pic).

Does anybody knows how to do that ?
Lazarus 1.6.2
fpc 3.0.0
wince/win32/win64
delphi berlin

vincococka

  • Full Member
  • ***
  • Posts: 101
Re: Does anybody know how to display the keyboard SIP icon ?
« Reply #1 on: September 30, 2014, 09:45:43 am »
Hi,

Can you please explain further why you want SIP icon? I`m just trying to understand.

Why not show directly input panel aligned to the bottom of the screen?

Try to look @ following 3 methods:
Code: [Select]
procedure TfrmMain.ActiveControlChanged (Sender: TObject) ;

Code: [Select]
procedure MoveSipImToBottom;
var
  rect : TRECT;
  hSipIM: HANDLE = 0;
begin
  hSipIm := FindWindow('SipWndClass', nil);
  if hSipIm > 0 then
    if GetWindowRect(hSipIM, rect) then begin
       MoveWindow(hSipIM, rect.Left, GetSystemMetrics(SM_CYSCREEN) - (rect.Bottom - rect.Top), rect.Right - Rect.Left, rect.Bottom - rect.Top, True);
    end;
end;

Code: [Select]
procedure MoveSipImToOriginalPosition;
var
  rect  : TRECT;
  hSipIM: HANDLE = 0;
begin
  hSipIm := FindWindow('SipWndClass', nil);
  if hSipIm > 0 then
    if GetWindowRect(hSipIM, rect) then begin
       MoveWindow(hSipIM, rect.Left, GetSystemMetrics(SM_CYSCREEN) - (rect.Bottom - rect.Top) -  25, rect.Right - Rect.Left, rect.Bottom - rect.Top, True);
    end;
end;


PS: ActiveControl method - you need to implement your own...

V.
---
  Guide me God and I`ll find you

vincococka

  • Full Member
  • ***
  • Posts: 101
Re: Does anybody know how to display the keyboard SIP icon ?
« Reply #2 on: October 03, 2014, 10:32:55 pm »
Hi,

I was solving opposite problem - after MessageBox MS_SIPBUTTON appeared in foreground and stayed there.

Solution to your problem - here you go my friend :)

Code: [Select]
var
  win: HWND;
begin
  win := FindWindow('MS_SIPBUTTON', 'MS_SIPBUTTON');
  MoveWindow (win, 10,10, 40,30, True); // this is only to show that we have proper Window
  ShowWindow(win, SW_SHOW);
---
  Guide me God and I`ll find you

swierzbicki

  • Full Member
  • ***
  • Posts: 177
Re: Does anybody know how to display the keyboard SIP icon ?
« Reply #3 on: November 17, 2014, 03:55:36 pm »
Thank you :) this is working as expected.

Code: [Select]
procedure KeyboardSIP(Show: boolean);
var
  SipHandle, ChildHandle: THandle;
begin
  SipHandle := FindWindow('MS_SIPBUTTON', 'MS_SIPBUTTON');
  if (SipHandle = 0) then
    exit;

  ChildHandle := GetWindow(SipHandle, GW_CHILD);
  if (ChildHandle <> 0) then
  begin
    if Show then
    begin
       ShowWindow(ChildHandle, SW_SHOWNORMAL or SW_SHOWNOACTIVATE);
       ShowWindow(SipHandle, SW_SHOWNORMAL or SW_SHOWNOACTIVATE);
       MoveWindow (SipHandle, 133,276, 44,44, True); // this is only to show that we have proper Window
       SetWindowPos(SipHandle,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE + SWP_NOSIZE);
    end
    else
    begin
      ShowWindow(ChildHandle, SW_HIDE);
      ShowWindow(SipHandle, SW_HIDE);
      SetWindowPos(SipHandle,HWND_BOTTOM,0,0,0, 0,SWP_NOMOVE + SWP_NOSIZE);
    end;
  end;
end;

I just have one issue, my keyboard logo is no more themed (you can see the attached picture)
Lazarus 1.6.2
fpc 3.0.0
wince/win32/win64
delphi berlin

vincococka

  • Full Member
  • ***
  • Posts: 101
Re: Does anybody know how to display the keyboard SIP icon ?
« Reply #4 on: November 18, 2014, 03:53:01 pm »
IMHO, why not develop a custom input panel for user that mimics iOs/Android default keyboards? I think that the effort you put in will be worth of it.
I`ve done this for my current work and users are pretty happy with bigger buttons so they doesn`t need glasses anymore :).
---
  Guide me God and I`ll find you

swierzbicki

  • Full Member
  • ***
  • Posts: 177
Re: Does anybody know how to display the keyboard SIP icon ?
« Reply #5 on: November 28, 2014, 02:48:10 pm »
Well, this could be a better idea but I'm right now short in time :D
I'll do it a little bit later !

Thanks
Lazarus 1.6.2
fpc 3.0.0
wince/win32/win64
delphi berlin

 

TinyPortal © 2005-2018