Re: VirtualAllocEx alternative?
- From: "Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT com>
- Date: Mon, 11 Aug 2008 16:09:50 -0700
And, after playing with this further, I don't seem to be able to get the
item strings back from a listbox, at least. It's worth looking around to
see what you can find in the archives about getting information from windows
in other processes, but I wouldn't be super confident.
http://groups.google.com/group/microsoft.public.dotnet.framework.compactframework/topics
http://groups.google.com/advanced_search?q=&hl=en& (for
microsoft.public.windowsce.*; note that Google has been having some
group-specific searching problems lately, so you may end up getting results
from all newsgroups with this one)
Paul T.
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:uKkHgy$%23IHA.5336@xxxxxxxxxxxxxxxxxxxxxxx
You'll have to verify that you can get a handle to the control using some
combination of FindWindow() and GetWindow(). If you can get a handle to
the window, you'll have to try to ask it, by SendMessage() or
PostMessage(), to list its items. Since this is a cross-process call, I'd
say that SendMessage is probably your best choice. Something roughly like
this is where I'd start:
HWND wnd = FindWindow( NULL, _T( "Top level window name for the
application that owns the list" ) );
HWND child = GetWindow( wnd, GW_CHILD );
while (child)
{
// Check, somehow, and see if child is the right window for you. You
might send it a list
// message that should always succeed and see whether it responds
appropriately or
// something like that.
if ( !thisIsMyTargetWindow( child ) )
{
child = GetWindow( child, GW_HWNDNEXT );
}
else
{
break;
}
}
// If you got here and child is not null, you found something.
if ( child )
{
result = SendMessage( child, LVM_GETITEM, param1, param2 );
// Repeat as necessary to do what you want to do.
}
I hope that I've pseudocoded this cleanly... Obviously, this is all
native code, or P/Invokes, that you'd have to write. There's definitely
no built-in way to do this and I'm not clear on whether it would work in
CE6 and later or not.
So, this third-party application doesn't save the data anywhere? Doesn't
do anything with it that you might intercept or use as an alternate source
of the data besides trying to grab it from the other application?
Paul T.
"ME" <trash.trash@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:WPOdnWrYbf6tLD3VnZ2dnUVZ_o_inZ2d@xxxxxxxxxxxxxx
I totally agree that this is a POOR design, however with *absolutely no
control* over the third party app, I see no other approach that would work
here. The good news is I don't need to "write" back to the controls, just
read them (their contents mostly). That said, my question was not if I
should do it this way, but rather, is it even possible? From the sounds
of things it just isn't in Windows Mobile. Is this a fair assessment?
Thanks,
Matt
"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message
news:Orc%23qi8%23IHA.2056@xxxxxxxxxxxxxxxxxxxxxxx
You might be able to send a message to the program with the listview and
enumerate the items in the list, but this architecture is POOR, at best.
Going over and grabbing stuff from other applications is something that
should and, generally, is blocked by the OS for obvious reasons. Have
the other program write the data to a disk file or, as Chris said,
rewrite it to provide a documented and supportable method of accessing
the data from another process.
You're absolutely certain that there is not some better way to
accomplish this already in place? Think outside the bounds of how
you've done it before.
Paul T.
"ME" <trash.trash@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:buWdnbbqX5JtXQHVnZ2dnUVZ_hWdnZ2d@xxxxxxxxxxxxxx
MessageWindow looks interesting but would be the best way to accomplish
reading the List Items from a ListView control that is not in my
process? Basically I have an application that is displaying a ListView
(for which I have can not change) and I need to write a background
application that can retrieve the list items from a ListView it is
using. *Similar* to this idea (though this is for the Full Framework):
http://dotnetjunkies.com/WebLog/chris.taylor/archive/2004/05.aspx
So if I used MessageWindow to send the LVM_GETITEM message could I
access the LV_ITEM data by listening to the WindProc? I am sorry if I
sound green on this (I am).
Thanks,
Matt
"Chris Tacke, eMVP" <ctacke.at.opennetcf.dot.com> wrote in message
news:uTJTFzY%23IHA.4196@xxxxxxxxxxxxxxxxxxxxxxx
Even in CE it's a kernel call, so for CE 6.0 and later an app can't
call it anyway. That said, you certainly wouldn't want to do this
anyway (in fact I seriously doubt it's a good idea on the desktop
either). If you need to do IPC under CE, there are really 3
reasonable ways to do so:
1. Via a MessageWindow and a WM_COPY message (just like the desktop)
2. A memory mapped file (just like the desktop)
3. A point to point message queue (CE specific)
#2 [1] and #3 [2] have managed object model wrappers around them in
the Smart Device Framework.
[1]
http://opennetcf.com/library/sdf/html/efc7db91-9586-acbb-212b-e28d298c49e8.htm
[2]
http://opennetcf.com/library/sdf/html/ab10b803-66c9-fcb5-3772-e0bad65b6d86.htm
[3] www.smartdeviceframework.com
--
Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
"ME" <trash.trash@xxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4e6dnYNYhv2bBgHVnZ2dnUVZ_uydnZ2d@xxxxxxxxxxxxxx
I am writing a app for Windows Mobile 6 (and maybe mobile 5) and I
need to send a message to another process' control (listview for
example) and then read a struct/object back from that control. In the
full framework I would use P/Invoke to call VirtualAllocEx and write
my object into a buffer inside the second process (among other
methods). Unfortunately VirtualAllocEx is not supported on Windows
Mobile 6 (it is on Windows CE 6, but not Mobile) according to the
documentation: http://msdn.microsoft.com/en-us/library/aa909179.aspx .
Are there alternatives to VirtualAllocEx that one can implement, even
if it is a bit more work? If so does anyone have any examples they
can share?
Thanks,
Matt
.
- References:
- VirtualAllocEx alternative?
- From: ME
- Re: VirtualAllocEx alternative?
- From: Chris Tacke, eMVP
- Re: VirtualAllocEx alternative?
- From: ME
- Re: VirtualAllocEx alternative?
- From: Paul G. Tobey [eMVP]
- Re: VirtualAllocEx alternative?
- From: ME
- Re: VirtualAllocEx alternative?
- From: Paul G. Tobey [eMVP]
- VirtualAllocEx alternative?
- Prev by Date: Re: VirtualAllocEx alternative?
- Next by Date: Re: Home/Visiting Clock in windows mobile
- Previous by thread: Re: VirtualAllocEx alternative?
- Next by thread: acomplia suisse soft generique acheter acomplia bon marche en ligne Achat acomplia Simple citrate de Rimonabant bon marche canada on acomplia en France a vendre
- Index(es):
Relevant Pages
|