First I'd like to thank mtettmar for the helpful reply. It's some strange I can't reply to my last post, so I open a new.
LibFunc is really useful! I wonder whether MS can call all the Windows API functions?
I tried another api to paste one bmp file on another:
LibFunc>gdi32.dll,BitBlt,r,c:\1.bmp,x,y,320,240,c:\2.bmp,0,0,SRCCOPY
Here's the function definition:
BOOL BitBlt (HDC hdcDest,int nXDest,int nYDest,int nWidth,int nHeight,HDC hdcSrc,int nXSrc,int nYSrc,DWORD dwRop)
What am I wrong?
p.s. MS seems not so powerful dealing with pictures. ImageMagick is. Is it possible for MS to use ImageMagick function?
LibFunc and Windows API
Moderators: JRL, Dorian (MJT support)
-
- Automation Wizard
- Posts: 1101
- Joined: Fri Jan 07, 2005 5:55 pm
- Location: Somewhere else on the planet
Re: LibFunc and Windows API
Yes, MacroScheduler + ImageMagick is a great combination, I use it a lot.Aleu wrote:p.s. MS seems not so powerful dealing with pictures. ImageMagick is. Is it possible for MS to use ImageMagick function?
I think I have posted some examples on this forum, one is in this thread.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
That function is saying it wants a handle to a device context (HDC) for the destination and the source. But you are specifying a filename.I tried another api to paste one bmp file on another:
LibFunc>gdi32.dll,BitBlt,r,c:\1.bmp,x,y,320,240,c:\2.bmp,0,0,SRCCOPY
Here's the function definition:
BOOL BitBlt (HDC hdcDest,int nXDest,int nYDest,int nWidth,int nHeight,HDC hdcSrc,int nXSrc,int nYSrc,DWORD dwRop)
What am I wrong?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Handle
Ok, to get a file's handle:
LibFunc>kernel32.dll,CreateFile,FileHandle,C:\1.bmp,GENERIC_WRITE,NULL,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL
Message>FileHandle
Again it didn't work! It said the dll can't be loaded. How the hell can I get the file's handle?
p.s. I agree ImageMagick is wonderful. XP also has powerful API function for pictures, but quite complicated. If you don't want to rely on the third-party software, use these funtions.
LibFunc>kernel32.dll,CreateFile,FileHandle,C:\1.bmp,GENERIC_WRITE,NULL,NULL,OPEN_EXISTING,FILE_FLAG_OVERLAPPED,NULL
Message>FileHandle
Again it didn't work! It said the dll can't be loaded. How the hell can I get the file's handle?
p.s. I agree ImageMagick is wonderful. XP also has powerful API function for pictures, but quite complicated. If you don't want to rely on the third-party software, use these funtions.
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
1. The function alias is CreateFileA - there's no such export as CreateFile
2. Have you declared the values for GENERIC_WRITE, NULL, OPEN_EXISTING and FILE_FLAG_OVERLAPPED - these are not Macro Scheduler variables and you don't appear to have given them any values in your script so these are just literal strings and will cause the function to crash.
2. Have you declared the values for GENERIC_WRITE, NULL, OPEN_EXISTING and FILE_FLAG_OVERLAPPED - these are not Macro Scheduler variables and you don't appear to have given them any values in your script so these are just literal strings and will cause the function to crash.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?