wx and windows/mac right-click menu shell extensions

19 views
Skip to first unread message

Sachin Garg

unread,
Oct 27, 2009, 5:34:49 PM10/27/09
to wx-u...@googlegroups.com
What would be the best way to add right-click context menu items in
windows explorer and mac finder?

(best = easiest to develop and maintain for an otherwise portable app,
not necessarily the most powerful way).


And how to make them work with wxwidgets? Currently I am using
IMPLEMENT_APP which implements main. Will the context-menu's provide
command-line arguments which I can handle in my app, or will I need to
provide special dll/com entry points which will need to somehow
initialize wx?

Any pointers in the right direction will help, even if its just the
correct google keywords to search for.

SG

Vadim Zeitlin

unread,
Oct 30, 2009, 2:23:30 PM10/30/09
to wx-u...@googlegroups.com
On Wed, 28 Oct 2009 03:04:49 +0530 Sachin Garg <sch...@gmail.com> wrote:

SG> What would be the best way to add right-click context menu items in
SG> windows explorer and mac finder?

I don't think there is any best way, there is no support for this in wx so
I guess you'd have to write 2 separate implementations for this code.

SG> And how to make them work with wxwidgets? Currently I am using
SG> IMPLEMENT_APP which implements main. Will the context-menu's provide
SG> command-line arguments which I can handle in my app, or will I need to
SG> provide special dll/com entry points which will need to somehow
SG> initialize wx?

Under Windows you will need to implement COM interfaces and your code will
be in a DLL. So you need to build your code as a DLL but it's not a problem
normally.

SG> Any pointers in the right direction will help, even if its just the
SG> correct google keywords to search for.

"Shell extensions" for MSW. No idea for Mac, sorry.

Regards,
VZ

--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/

Stefan Csomor

unread,
Oct 31, 2009, 10:33:51 AM10/31/09
to wx-u...@googlegroups.com
Hi

> SG> Any pointers in the right direction will help, even if its just the
> SG> correct google keywords to search for.
>
> "Shell extensions" for MSW. No idea for Mac, sorry.

Finder Contextual Menu Plugin

http://developer.apple.com/legacy/mac/library/samplecode/SampleCMPlugIn/inde
x.html

HTH

Stefan

Sachin Garg

unread,
Nov 1, 2009, 6:29:55 PM11/1/09
to wx-u...@googlegroups.com

Thanks for setting me on the right path Stefan, I read it will work
only till OSX 10.5. From 10.6 Apple wants these menu's to be
implemented as services (which shows up in services menu *and* in
finder menu).

I haven't read completely but it seems that new method is less
powerful/flexible than previous method, but seems easier to implement
(might even be created by just using automator, no coding needed).

SG

Sachin Garg

unread,
Nov 1, 2009, 6:35:10 PM11/1/09
to wx-u...@googlegroups.com
On Fri, Oct 30, 2009 at 11:53 PM, Vadim Zeitlin <va...@wxwidgets.org> wrote:
> On Wed, 28 Oct 2009 03:04:49 +0530 Sachin Garg <sch...@gmail.com> wrote:
>
> SG> What would be the best way to add right-click context menu items in
> SG> windows explorer and mac finder?
>
>  I don't think there is any best way, there is no support for this in wx so
> I guess you'd have to write 2 separate implementations for this code.
>
> SG> And how to make them work with wxwidgets? Currently I am using
> SG> IMPLEMENT_APP which implements main. Will the context-menu's provide
> SG> command-line arguments which I can handle in my app, or will I need to
> SG> provide special dll/com entry points which will need to somehow
> SG> initialize wx?
>
>  Under Windows you will need to implement COM interfaces and your code will
> be in a DLL. So you need to build your code as a DLL but it's not a problem
> normally.

In my exe, IMPLEMENT_APP implements the winmain which initializes wx.
How do I initialize wx when entry point will not be main in the dll?

One hackish way I am thinking of is that after IMPLEMENT_APP I can add a

#define winmain __wxmain

And then call this __wxmain whenever I am ready to start the wx gui in
dll. Will this work? any better way?

> SG> Any pointers in the right direction will help, even if its just the
> SG> correct google keywords to search for.
>
>  "Shell extensions" for MSW. No idea for Mac, sorry.

Thanks, found the right references.

SG

Vadim Zeitlin

unread,
Nov 3, 2009, 9:41:06 AM11/3/09
to wx-u...@googlegroups.com
On Mon, 2 Nov 2009 05:05:10 +0530 Sachin Garg <sch...@gmail.com> wrote:

SG> In my exe, IMPLEMENT_APP implements the winmain which initializes wx.
SG> How do I initialize wx when entry point will not be main in the dll?

Using wxInitialize if you don't want to start the main loop or
wxEntry[Start]() if you. See many, many previous discussions of creating
DLLs using wx in the archives.

Reply all
Reply to author
Forward
0 new messages