forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Chromium Control

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code
View previous topic :: View next topic  
Author Message
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Wed May 08, 2013 3:55 am    Post subject: Chromium Control Reply with quote

ORIGINAL POST REPLACED with most recent example. 5/9/2013 12:13 A MTN

Requires
http://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?path=Win/173951/

process seperation for multiple controls, alternate launch methods that work/partially work.
--app=url (no tabs, no navigation)
--chrome-frame --kiosk
--incognito --kiosk
--kiosk

Major issues
No way to inject javascript into window to update/set DOM elements. Cannot be resolved.

Minor Issues
Have not yet figured out how to pull info from DOM, but should be able to use form/post or a new protocol to do so. Even adding DOM elements to javascript hash should work.

Code:

%%chromeframe1 = @winexists(#Chrome_WidgetWin_1)

shell open,@path(%0)chrome-win32\chrome.exe,--kiosk --user-data-dir=/tmp/chrome --login-profile=user --login-manager @chr(34)@path(%0)action listener.html@chr(34)
rem shell open,@path(%0)chrome-win32\chrome.exe,--kiosk --user-data-dir=/tmp/chrome --login-profile=user --login-manager www.google.com
rem shell open,@path(%0)chrome-win32\chrome.exe,--kiosk --user-data-dir=/tmp/chrome --login-profile=user --login-manager www.yahoo.com



repeat
wait .1
  %%chromeframe = @winexists(#Chrome_WidgetWin_1)
until @not(@equal(%%chromeframe,%%chromeframe1))

  title Chromium
  dialog CREATE,Chromium Control,-1,0,1024,600,CLASS chromium,resizable
    dialog ADD,BUTTON,WhereAmI,0,0,100,37,WhereAmI
    dialog add,button,GoTo,0,100,100,37,GoTo
    dialog add,button,Title,0,200,100,37,Title
    dialog add,button,Tab1,0,300,100,37,Tab1
    dialog add,button,Tab2,0,400,100,37,Tab2
    dialog add,button,Tab3,0,500,100,37,Tab3
    dialog add,button,Back,0,600,100,37,Back
dialog add,button,Forward,0,700,100,37,Forward
  rem *** Modifchromed by Dialog Designer on 5/6/2013 - 15:17 ***

  %%chromeframehandle = @strdel(%%chromeframe,1,1)
  loadlib user32
  rem window can't be shown when applying child class
 window hide,%%chromeframe
 %%knockout = @lib(user32,SetWindowLongA,INT:,%%chromeframehandle,-16,$40000000)
   %%tempvariable = @lib(user32,SetParent,INT:,%%chromeframehandle,@strdel(@winexists(#chromium),1,1))
            window normal,%%chromeframe
  freelib user32
    dialog SHOW
   
repeat
wait .1
until @winexists(@window(%%chromeframe,child))
window hide,@window(%%chromeframe,child)

       window position,%%chromeframe,37,0,@dlgpos(,W),@diff(@dlgpos(,H),37)

  :resize
   window position,%%chromeframe,37,0,@dlgpos(,W),@diff(@dlgpos(,H),37)
   
   :timer
      %%chromechild = @window(%%chromeframe,child)
%%laction = @wintext(@window(%%chromechild,next))
%%action = @substr(%%laction,@sum(@pos("#",%%laction),1),@len(%%laction))

if @equal(%%action,myaction)
 goto %%action
end

%%title = @wintext(@window(%%chromeframe,child))
if %%title
dialog title,%%title
title %%title
end

:evloop
  wait event,.1
  goto @event()
 
:myaction
shell open,notepad
wait .1
window send,#notepad,Cool huh?
rem Allow timeout!
wait 1
goto evloop

:WhereAmIButton

%%chromechild = @window(%%chromeframe,child)
info @wintext(@window(%%chromechild,next))
  goto evloop
 
  :gotobutton
 #  shell open,chrome,--incognito --kiosk @input(GoTo)
      # OR
   shell open,@path(%0)chrome-win32\chrome.exe,--kiosk --user-data-dir=/tmp/chrome --login-profile=user --login-manager @input(GoTo)
  goto evloop
 
  :titlebutton
  info @wintext(@window(%%chromeframe,child))
  goto evloop

:close
  loadlib user32.dll
  if @ok()
%%controlsampledummy = @lib(user32.dll,SetParent,NIL,%%chromeframehandle,0)
  end
  freelib user32.dll
  window close,%%chromeframe
  exit
 
  :tab1button
  run @path(%0)ctrl.exe ctrl @window(@window(%%chromeframe,child),child) 1
  goto evloop
 
    :tab2button
  run @path(%0)ctrl.exe ctrl @window(@window(%%chromeframe,child),child) 2
  goto evloop
 
      :tab3button
  run @path(%0)ctrl.exe ctrl @window(@window(%%chromeframe,child),child) 3
  goto evloop
 
  :forwardbutton
  run @path(%0)ctrl.exe alt-key @window(@window(%%chromeframe,child),child) right
  goto evloop
 
  :backbutton
  run @path(%0)ctrl.exe alt-key @window(@window(%%chromeframe,child),child) left
  goto evloop
 
    rem CTRL.exe
if @equal(%1,ctrl)
goto ctrl
end

if @equal(%1,alt-key)
goto alt-key
end

rem END HEADER - TOP OF FILE

:ctrl
window send,%2,@ctrl(%3)
stop

:alt-key
window send,%2,@alt(@key(%3))
stop



ACTION LISTENER.HTML
Code:
<html>
<head>
<script language="javascript">
setInterval(function(){location.hash = "#reset";},1000);
</script>

</head>
<body>


<a href="#myaction">Action</a>
</body>
</html>


Last edited by cnodnarb on Thu May 09, 2013 6:14 am; edited 9 times in total
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Wed May 08, 2013 4:18 am    Post subject: Reply with quote

--chrome-frame --kiosk has cookies.

No reason not to use it, unless you need your user to log in to a live account.

For some reason Microsoft can't see that --chrome-frame DOES allow cookies. Use --incognito instead but only in this or similar cases.
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Wed May 08, 2013 4:21 am    Post subject: Reply with quote

In addition, for some STRANGE reason this control in --chrome-frame mode is treated like a new webbrowser, but it will save settings.

So say two users on a machine... you can use Chrome, and your wife can use a Chrome Control app.

I don't understand the mechanics behind this at all yet.

Use at your own risk.
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Wed May 08, 2013 4:35 am    Post subject: Reply with quote

Redistributable solution? Maybe Wink Have to switch to Chromium.

http://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?path=Win/
Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Wed May 08, 2013 6:02 am    Post subject: Reply with quote

http://commondatastorage.googleapis.com/chromium-browser-snapshots/index.html?path=Win/173951/

Took a few tries to find the right version. Ever play the "guess my number" game?

Code:

%%chromeframe1 = @winexists(#Chrome_WidgetWin_1)

# shell open,chrome,--incognito --kiosk www.google.com
# OR
 shell open,@path(%0)chrome-win32\chrome.exe,--kiosk --chrome-frame --user-data-dir=/tmp/chrome --login-profile=user --login-manager www.google.com
# But no cookies.

repeat
wait .1
  %%chromeframe = @winexists(#Chrome_WidgetWin_1)
until @not(@equal(%%chromeframe,%%chromeframe1))

# Not necessary for --chrome-frame mode.



  title Chrome Control
  dialog CREATE,Chrome Control,-1,0,1024,600,CLASS Google,resizable
    dialog ADD,BUTTON,WhereAmI,0,0,100,37,WhereAmI
    dialog add,button,GoTo,0,100,100,37,GoTo
  rem *** Modifchromed by Dialog Designer on 5/6/2013 - 15:17 ***

  %%chromeframehandle = @strdel(%%chromeframe,1,1)
  loadlib user32
  rem window can't be shown when applying child class
 window hide,%%chromeframe
 %%knockout = @lib(user32,SetWindowLongA,INT:,%%chromeframehandle,-16,$40000000)
   %%tempvariable = @lib(user32,SetParent,INT:,%%chromeframehandle,@strdel(@winexists(#google),1,1))
  freelib user32
    dialog SHOW
         window normal,%%chromeframe

       window position,%%chromeframe,37,0,@dlgpos(,W),@diff(@dlgpos(,H),37)

  :resize
   window position,%%chromeframe,37,0,@dlgpos(,W),@diff(@dlgpos(,H),37)

:evloop
  wait event
  goto @event()


:WhereAmIButton

%%chromechild = @window(%%chromeframe,child)
info @wintext(@window(%%chromechild,next))
  goto evloop
 
  :gotobutton
 #  shell open,chrome,--incognito --kiosk @input(GoTo)
      # OR
   shell open,@path(%0)chrome-win32\chrome.exe,--chrome-frame --kiosk --user-data-dir=/tmp/chrome --login-profile=user --login-manager @input(GoTo)
  goto evloop

:close
  loadlib user32.dll
  if @ok()
%%controlsampledummy = @lib(user32.dll,SetParent,NIL,%%chromeframehandle,0)
  end
  freelib user32.dll
  window close,%%chromeframe
  exit

Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Wed May 08, 2013 9:25 pm    Post subject: Reply with quote

Implement Action Listener

action listener.html
Code:

<html>
<head>
<script language="javascript">
setInterval(function(){location.hash = "#reset";},1000);
</script>
</head>
<body>
<a href="#myaction">Action</a>
<a href="#reset">Reset</a>
</body>
</html>


Code:

%%chromeframe1 = @winexists(#Chrome_WidgetWin_1)

# shell open,chrome,--incognito --kiosk www.google.com
# OR
 shell open,@path(%0)chrome-win32\chrome.exe,--kiosk --chrome-frame --user-data-dir=/tmp/chrome --login-profile=user --login-manager @chr(34)@path(%0)action listener.html@chr(34)
# But no cookies.

repeat
wait .1
  %%chromeframe = @winexists(#Chrome_WidgetWin_1)
until @not(@equal(%%chromeframe,%%chromeframe1))
# Not necessary for --chrome-frame mode.

  title Chrome Control
  dialog CREATE,Chrome Control,-1,0,1024,600,CLASS Google,resizable
    dialog ADD,BUTTON,WhereAmI,0,0,100,37,WhereAmI
    dialog add,button,GoTo,0,100,100,37,GoTo
  rem *** Modifchromed by Dialog Designer on 5/6/2013 - 15:17 ***

  %%chromeframehandle = @strdel(%%chromeframe,1,1)
  loadlib user32
  rem window can't be shown when applying child class
 window hide,%%chromeframe
 %%knockout = @lib(user32,SetWindowLongA,INT:,%%chromeframehandle,-16,$40000000)
   %%tempvariable = @lib(user32,SetParent,INT:,%%chromeframehandle,@strdel(@winexists(#google),1,1))
  freelib user32
    dialog SHOW
         window normal,%%chromeframe

       window position,%%chromeframe,37,0,@dlgpos(,W),@diff(@dlgpos(,H),37)

  :resize
   window position,%%chromeframe,37,0,@dlgpos(,W),@diff(@dlgpos(,H),37)
   
   :timer
   rem all HTML generated events MUST BE 8 CHARACTERS
      %%chromechild = @window(%%chromeframe,child)
%%laction = @wintext(@window(%%chromechild,next))
%%action = @substr(%%laction,@diff(@len(%%laction),7),@len(%%laction))

if @equal(%%action,myaction)
%%watch = link clicked.
rem info Link Clicked
rem ALLOW THE WINDOW TO TIME OUT
wait 1
%%watch = ""
end

:evloop
  wait event,.1
  goto @event()


:WhereAmIButton

%%chromechild = @window(%%chromeframe,child)
info @wintext(@window(%%chromechild,next))
  goto evloop
 
  :gotobutton
 #  shell open,chrome,--incognito --kiosk @input(GoTo)
      # OR
   shell open,@path(%0)chrome-win32\chrome.exe,--chrome-frame --kiosk --user-data-dir=/tmp/chrome --login-profile=user --login-manager @input(GoTo)
  goto evloop

:close
  loadlib user32.dll
  if @ok()
%%controlsampledummy = @lib(user32.dll,SetParent,NIL,%%chromeframehandle,0)
  end
  freelib user32.dll
  window close,%%chromeframe
  exit

Back to top
View user's profile Send private message AIM Address
cnodnarb
Valued Contributor
Valued Contributor


Joined: 11 Sep 2002
Posts: 686
Location: Evansville, IN

PostPosted: Thu May 09, 2013 7:43 pm    Post subject: Reply with quote

http://support.microsoft.com/kb/108315

Translates to

Code:

   LOADLIB user32.dll
  %%SetWindowPos = @lib(user32.dll,SetWindowPos,INT:,@strdel(%%float,1,1),0,-5,-5,70,75,$0003)
FREELIB user32.dll


placed within :timer

Needed to float controls in notitle child windows over Chrome control.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Visual DialogScript 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum




Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group