Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Truly closing Toolbar Browser
#1
Hi,
I am successfully using Toolbar with WebBrowser function (OpenInTbWebBrowser)

But the webpage I am opening requires a login. Each individual user should have their own login. However, once the first person logs in, the prompt to get a new user login never comes up again unless quickmacros is exited. If I was logging in to this page via a regular web browser, I could just close this browser and then reopen a new browser and attempt to open the webpage to get a new user login prompt. But this function seems to keep the "virtual" browser open (and thereby holding on to the user login information), even if I close the toolbar that calls that function.

Is it possible to wipe clear the webbrowser, so that the next time the toolbar with the webbrowser hook gets called up, it will prompt for the login just like usual?

I hope that was an ok explanation...

Stuart

Code:
Copy      Help
;/
function# hWnd message wParam lParam

sel message
,case WM_CREATE
,int h=CreateControl(0 "ActiveX" "SHDocVw.WebBrowser" 0 -2 28 968 1178 hWnd 1)
,SHDocVw.WebBrowser b._getcontrol(h)
,b.Navigate("samplewebpage.edu" )
,case WM_DESTROY
#2
Use web browser control in a dialog instead of in a toolbar. Then the macro could run in separate process.
#3
Hi Gintaras,
Thanks, I will try this. But currently, the toolbar opens up via "hover" with auto-unshrink. It would not be a big deal to click on it (it has to expand from a small button to the full webpage), but just wondering if shrink properties can be part of dialogs?

Thanks again,
Stuart
#4
Function DT_AutoShrink
Code:
Copy      Help
;/
function# hDlg message wParam lParam

;Adds simple auto-shrink (actually roll-up) feature for a dialog.
;The dialog must be a smart dialog, ie with dialog function.
;Insert the following statement in the dialog function, before 'sel message' line:


;DT_AutoShrink hDlg message wParam lParam


type DASDATA !shr RECT'r
DASDATA* d=+GetProp(hDlg "qm_das")

sel message
,case WM_INITDIALOG
,SetProp hDlg "qm_das" d._new
,goto shrink
,case WM_DESTROY
,d._delete
,case [WM_SETCURSOR,WM_PARENTNOTIFY]
,if(d.shr) goto shrink
,case WM_TIMER
,sel wParam
,,case 1578
,,if(win(mouse)!=hDlg and !GetCapture) goto shrink
ret

;shrink
d.shr^1
if(d.shr)
,KillTimer hDlg 1578
,GetWindowRect hDlg &d.r
,TITLEBARINFO ti.cbSize=sizeof(TITLEBARINFO)
,GetTitleBarInfo hDlg &ti
,int hei
,if(ti.rgstate[0]&STATE_SYSTEM_INVISIBLE) hei=20
,else hei=ti.rcTitleBar.bottom-ti.rcTitleBar.top+4
,siz 0 hei hDlg 1
else
,siz 0 d.r.bottom-d.r.top hDlg 1
,SetTimer hDlg 1578 100 0

Example function dialog_autoshrink
Code:
Copy      Help
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages

str controls = "3"
str ax3SHD
ax3SHD="http://www.quickmacros.com"
if(!ShowDialog("dialog_autoshrink" &dialog_autoshrink &controls)) ret

;BEGIN DIALOG
;0 "" 0x90C80A44 0x0 0 0 223 135 "Dialog"
;1 Button 0x54030001 0x4 120 116 48 14 "OK"
;2 Button 0x54030000 0x4 170 116 48 14 "Cancel"
;3 ActiveX 0x54030000 0x0 0 14 224 100 "SHDocVw.WebBrowser"
;END DIALOG
;DIALOG EDITOR: "" 0x2020100 "" ""


ret
;messages

DT_AutoShrink hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
#5
Hi Gintaras,

Thank you so much for the code to shrink Toolbar. It works and is very cool but I don't have screen real estate for widebar - large enought for whole webpage. Toolbar is great because I could shrink down to Icon size and then hover expand to set wider width and height (so cool!) I don't think you can do this with the code you wrote. I hate to suggest something that you will have to do a lot more work for! Better if there was some easy way to "close the webbrowser"internally so that next time toolbar runs, it is as if its opening a new browser - this will re-initiate the login prompt for the secured website.

Also, though I generally don't like IE7, the ability to zoom by Ctrl-mousewheel is quite nice. How does the WebinToolbar Browser know which browser to open with - besides IE7, there is Slimbrowser, Opera, etc. Again, I actually like the simplicity of IE6 and that it opens quickly but just wondering.

Thanks,
Stuart
#6
The code can be extended to add more features, eg shrink to icon size, or change direction.

I don't know how to close the webbrowser-server connection.

The web browser control is installed together with IE. It is used by IE, and also can be used in other programs.
#7
Hi Gintaras,
I think I understand. Funny thing is that when I close quickmacros, and then restart it. It "
releases" the web page.

Is there any way, through a macro, I can tell quickmacros to close itself and then immediately restart. This would be just an occasional command given - as a new user starts using the program, not something that would be given over and over.

Thanks,
Stuart
#8
Search for "restart" in QM help.
#9
thats a very nice widget.
pi
#10
i was trying your example and got unknown identifiers on this
TITLEBARINFO and also this
GetTitleBarInfo
#11
You need QM 2.2.0 or later. Or insert this somewhere before:

Code:
Copy      Help
type TITLEBARINFO cbSize RECT'rcTitleBar rgstate[6]
dll user32 #GetTitleBarInfo hwnd TITLEBARINFO*pti
def STATE_SYSTEM_INVISIBLE 0x00008000
#12
ty vm sir worked on 2.1.9 but had to remove this line
def STATE_SYSTEM_INVISIBLE 0x00008000


Forum Jump:


Users browsing this thread: 1 Guest(s)