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 


Graphics on button element
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Jul 12, 2005 1:10 pm    Post subject: Reply with quote

Hi Joe,

One other thing that you might be able to do is include your buttons
graphic as a resource and then use the LoadBitmap() API.

Replace the LoadImageA() API with the following, please note that this will
only work if your script is compiled into an exe::
Code:

  REM This assumes your image is name BTNIMG
  %%hinst = @lib(user32.dll,  GetModuleHandleA, INT:, INT: 0)

  REM For bitmaps use ...
  %%bitmap = @lib(user32.dll, LoadBitmapA, INT:, INT: %%hinst, STR: BTNIMG)
  REM And for icons use...
  %%icon = @lib(user32.dll, LoadIconA, INT:, INT: %%hinst, STR: BTNIMG)


That's the only other way. Remember that if the ...A() APIs don't work to
change to ...W() APIs.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Jul 12, 2005 2:09 pm    Post subject: Reply with quote

One last thought...
You could also make a button image and put a BITMAP in place of the
BUTTON. Only problem to this approach is that it won't work/look exactly
like a BUTTON element.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Jul 12, 2005 5:26 pm    Post subject: Reply with quote

Thanks Bill for your efforts on this. It is appreciated.

I think I set it up correctly, but I am getting an error 38 at the line that has GetModuleHandleA (or with a "W").

_________________
Joe Floyd
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Jul 12, 2005 8:16 pm    Post subject: Reply with quote

Sorry Joe.

GetModuleHandleA() is in kernel32.dll.
Code:

  %%hinst = @lib(kernel32.dll, GetModuleHandleA, INT:, INT: 0)


That should fix it, I think.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Jul 12, 2005 8:54 pm    Post subject: Reply with quote

No luck there, either.

Just to make sure I was doing it right:

I called FREELIB user32.dll, then LOADLIB the kernel .dll, then use the .dll call, then FREELIB that, then LOADLIB user32.

Is that right?

_________________
Joe Floyd
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Jul 12, 2005 9:37 pm    Post subject: Reply with quote

As far as I know you don't need to use FREELIB to call into another library.

I would just call LOADLIB for both libraries at the beginning of your script
and on exit call FREELIB for both dlls.

Call Kernel32.dll for the GetModuleHandleA() API.
And then use user32.dll for all the other API calls.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Jul 12, 2005 10:02 pm    Post subject: Reply with quote

Try this Joe, there is a small error in my last post ::
Code:

  %%hinst = @lib(kernel32.dll, GetModuleHandleA, INT:, NIL:)

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
jwfv
Valued Contributor
Valued Contributor


Joined: 19 Mar 2002
Posts: 422
Location: Beaufort, SC

PostPosted: Tue Jul 12, 2005 10:04 pm    Post subject: Reply with quote

That didn't seem to produce any effect either. I don't know what the deal is - wish you could test it some way, but we are on different OSes and different VDS versions.

I guess I may just have to live with the "Reports ..." button, etc. for now.

Thanks for all your efforts, Bill - if you think of any other ideas I am game for trying them.

_________________
Joe Floyd
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Tue Jul 12, 2005 10:08 pm    Post subject: Reply with quote

VDS is the reason I ventured off to learn C/C++ and a few others. Since
learning them, I don't use VDS much accept for testing dlls, and writing
quick utilities. So I have no need for anything more than VDS 4.5.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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