OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Thread Tools Search this Thread Display Modes
Old 03-07-2006, 15:10
Posts: n/a
Default Unsharp Mask dialog box

How I can show standard Unsharp Mask dialog box from my code?
Reply With Quote
Old 04-07-2006, 12:17
wOxxOm's Avatar
wOxxOm wOxxOm is offline
Senior Member
Join Date: Mar 2005
Posts: 836

' this declare should be in MODULE of project (not Form and not Class) in the very top of code, before any other user-defined procedures or functions
Declare Function SendMessage& Lib "user32" Alias "SendMessageA" (ByVal hwnd&, ByVal Msg&, ByVal wParam&, ByVal lParam&)

' this is an example to invoke UnsharpMaskDialog, provided bitmap shape is currently selected
Sub callUnsharpMask()
   SendMessage AppWindow.Handle, &H111, &H1D70F, 0
End Sub
Anatomy of SendMessage in this case is -
1. we notify main CorelDRAW application which is described by AppWindow object, Handle property
2. we send WM_COMMAND=273 = &h111 in hex notation which I like
3. we send 55055 code (d70f in hex) prefixed by &h1 which means that higher word equals 1
4. zero is obligatory parameter which is ignored internally

To investigate all possible values and their visual equivalents you may write a loop:
Sub enumCommands()
Dim i&, t!, s$, ss$
For i = 50000 To 60000
   t = Timer
   SendMessage AppWindow.Handle, &H111, &H10000 + i, 0
   If Timer - t > 0.1 Then
      ss = CStr(i) + vbTab + InputBox(CStr(i), "Enter description")
      Debug.Print ss
      s = s + ss + vbNewLine
   End If
End Sub
To interrupt code execution press Ctrl-Break on keyboard
Reply With Quote
Old 04-07-2006, 17:38
Posts: n/a

Thanks. I understood basics of this method.
Reply With Quote
Old 04-07-2006, 21:42
Alex's Avatar
Alex Alex is offline
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4

Or you can use a program such as Spy++ to tap into application message loop and see what messages it receives. Filter WM_COMMAND only and start executing various menu commands and see what actual messages are sent to the application.

Unfortunately (or maybe fortunately for some), CorelDRAW is going away from standard windows UI implementation in sake of data binding. Many new commands in CorelDRAW 13 no longer send messages or have message handlers for. They use internal data binding mechanism which causes some internal code to be called directly when a menu or toolbar item is clicked. No WM_COMMAND is posted in this case...
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unsharp Mask dialog box geHucKa CorelDRAW/Corel DESIGNER VBA 0 03-07-2006 15:02
Problem with Common Dialog in Corel VBA RobC CorelDRAW/Corel DESIGNER VBA 3 13-05-2005 14:43
Importing from dialog... ddonnahoe CorelDRAW/Corel DESIGNER VBA 0 25-01-2005 08:26
format text dialog box implement graphicdesigner CorelDRAW/Corel DESIGNER VBA 5 22-12-2004 13:37
Missing font dialog on import click101 CorelDRAW/Corel DESIGNER VBA 2 28-04-2003 12:32

All times are GMT -5. The time now is 09:51.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com