Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
iAppsMail - Memory Usage Problem
#16
EXAMPLE 1 - IntPostFile with custom progress dialog.

Code:
Copy      Help
int hwnd=ShowDialog("" 0 0 0 1)

str localfile="$desktop$\quickm20.gi_"
IntGetFile "http://www.quickmacros.com/images/quickm20.gif" localfile 16 0 0 &IntGetFile_progress_callback hwnd
ren- localfile "$desktop$\quickm20.gif"

DestroyWindow hwnd

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 222 42 "Form"
;2 Button 0x54030000 0x4 164 24 48 14 "Cancel"
;3 msctls_progress32 0x54000000 0x0 8 6 204 14 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010900 "" ""

Function IntGetFile_progress_callback
Code:
Copy      Help
function# nbAll nbRead str&s fparam

if(!IsWindow(fparam)) ret 1 ;;Cancel
def PBM_SETPOS (WM_USER+2)
SendMessage id(3 fparam) PBM_SETPOS nbRead*100/nbAll 0

___________________

EXAMPLE 2 - Http.PostFormData with progress dialog.

Code:
Copy      Help
out
ARRAY(POSTFIELD) a.create(6); int i
a[i].name="exe1"; a[i].value="$system$\notepad.exe"; a[i].isfile=1; i+1
a[i].name="txt2"; a[i].value="some text 2"; a[i].isfile=0; i+1
a[i].name="userfile"; a[i].value="$desktop$\test.txt"; a[i].isfile=1; i+1
a[i].name="qml"; a[i].value="$desktop$\Macro295.qml"; a[i].isfile=1; i+1
a[i].name="txt"; a[i].value="some text 1"; a[i].isfile=0; i+1
a[i].name="exe2"; a[i].value="$system$\calc.exe"; a[i].isfile=1; i+1

int hwnd=ShowDialog("" 0 0 0 1)
Http h.Connect("www.quickmacros.com"); str r
if(!h.PostFormData("form.php" a r "" &PostFormData_progress_dialog hwnd)) end "failed"
out r

DestroyWindow hwnd

;BEGIN DIALOG
;0 "" 0x90C80A44 0x100 0 0 222 80 "Form"
;2 Button 0x54030000 0x4 168 62 48 14 "Cancel"
;3 msctls_progress32 0x54000000 0x0 30 6 186 12 ""
;4 msctls_progress32 0x54000000 0x0 30 24 186 12 ""
;5 Static 0x54000000 0x0 4 6 24 12 "Total"
;6 Static 0x54000000 0x0 4 24 22 12 "File"
;7 Static 0x54000000 0x0 4 42 212 16 ""
;END DIALOG
;DIALOG EDITOR: "" 0x2010900 "" ""

Function PostFormData_progress_dialog
Code:
Copy      Help
function# action nbAll nbRead $_file nbAllF nbReadF fparam
;out "%i %i %s %i %i %i" nbAll nbRead _file nbAllF nbReadF fparam

if(!IsWindow(fparam)) ret 1

def PBM_SETPOS (WM_USER+2)
SendMessage id(3 fparam) PBM_SETPOS nbRead*100/nbAll 0
lpstr st
sel action
,case 0 st="Sending data..."
,case 1
,st=_file
,SendMessage id(4 fparam) PBM_SETPOS nbReadF*100/nbAllF 0
,case 2 st="All data sent"
,case 3 st="Receiving response..."
,case 4 st="Finished"
SetDlgItemText fparam 7 st
0


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)