|
I don't know if it's the case here (it's been years since I programmed in Win32) but some messages parameters are not marshalled across process boundaries.
When you use WM_GETTEXT to get another process's window caption, Windows sees that you are passing a pointer, and copies the memory pointed to by the address in lParam to the other process, sends the message, and then brings the memory back to your process.
But if it's a app-specific message (above WM_USER ) Windows has no way of knowing that the lParam is a pointer to some memory located somewhere else in your process address space, instead of a scalar value.
In this case, you would need to use ReadProcessMemory /WriteProcessMemory (are they called like that?).
You could also try the WM_COPYDATA message. As far as I understand, this message was designed specifically for this kind of uses (interprocess communication) and the data gets marshalled automatically.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
hii all,
what is the Cache-Control and what is the diffrence between private and public cache?
thanks alot for your time.
marcoryos
|
|
|
|
|
Is a static object unique the the application compartment it is contained in? Or if you have 2 identical applications running, will they share the same static object?
I'm guessing it's independant. But i just need to check.
Cheers
Cata
|
|
|
|
|
|
Hi @all,
I have a ListView and a VScrollBar (I need the Scroll event...) on it with ListView.Scrollable set to false, because the ListView's ScrollBar would be on top always, so that I could not access my VScrollBar. But my problem is: How can I access the ListViewItems that are not visible? I tried to call the EnsureVisible() method at the Scroll event . The result was: The VScrollBar scrolled but the ListViewItems that are not visble didn't scrolled into view. It seems to be that the EnsureVisible() method only take effect if ListView.Scrollable is set to true. It must be a simple work - it drives me crazy! Please help!
|
|
|
|
|
If you make your control not scrollable, it won't scroll. I doubt there is a simple way around this, it's doing what you asked it to.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It could be possible to modify control styles to get rid of the scroll bar - must be done through interop though (calling into Win32 API) and still have control thinking it is there (by setting scrollbar's visible to false or similar). I don't think it is too easy as I had a lot of hard time fidling around ListView - it has a lot of strange behaviours under .NET (did you know it is owner-drawn under .NET at all times?)
Regards
JP
|
|
|
|
|
[DllImport("user32.dll")]
static extern bool ShowScrollBar(IntPtr hWnd, int wBar, bool bShow);
the call...
ShowScrollBar(listView1.Handle, 1, false);
...works!
Sebastian.
|
|
|
|
|
Has anyone created a method to self-destruct a program yet? Screw all the timed licenses and date-diffs, I want my program to just disapear at xxx time and not be recoverable. end of story! done deal!!!
any ideas?
any takers?
Dim Beautiful As String
Beautiful = "ignorant"
Label1.Text = "The world is full of " & Beautiful & " people."
Why is common sense such an un-common comodity?
|
|
|
|
|
Yeah, that's easy. You need a second program whose sole job is to delete the first. Then put it in the runonce section of the registry, and it will be deleted the next time the user starts their machine.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
Does anybody know if there is a SNMP simulator in C# out there?
Any help would be appreciated!
Thanks!
|
|
|
|
|
|
I have serialized my bussiness objects to a file and tried to deserialize them
but it took so much time that creating those objects and putting data into them from database is even faster.
Am I missing any thing?I have though that the deserialization process for my objects from a file should be much much faster as I do not have to create the objects?
MY CODE
***********************
public static void SerializeIdentityMapRegistry()
{
System.IO.Stream s = System.IO.File.OpenWrite(@"C:\Documents and Settings\dogat.ILKON\Desktop\imap.dat");
BinaryFormatter b = new BinaryFormatter();
b.Serialize(s, DAL.identityMap.IdentityMapRegistry.getInstance());
s.Close();
}
public static void DeserializeIdentityMapRegistry()
{
System.IO.Stream s = System.IO.File.OpenRead(@"C:\Documents and Settings\dogat.ILKON\Desktop\imap.dat");
BinaryFormatter b = new BinaryFormatter();
DAL.identityMap.IdentityMapRegistry.Instance = (DAL.identityMap.IdentityMapRegistry)b.Deserialize(s);
s.Close();
}
|
|
|
|
|
First of all:
No .Net serialization isn't very fast. Almost ever you will be by far faster if you (as an example) write a binary file yourself. But this surely means you have to do the major work yourself.
To your problem:
Check your DAL.identityMap.IdentityMapRegistry for unneeded references. Keep in mind that every reference this class holds gets also serialized (and those who are referenced by those which are referenced...). It's a very common mistake that just too much gets serialized - so check it carefully.
|
|
|
|
|
|
I'm using the articl of Twain published on the codeproject, but i have alittle problem which is:
the reutrn datatype is IntPtr, which i can't convert to a bitmap.
what can i do?
|
|
|
|
|
Is the IntPtr a GDI bitmap handle? If yes, look at the System.Drawing.Bitmap.FromHbitmap static method.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Homosexuality in Christianity
Judah Himango
|
|
|
|
|
I'm trying to use a combo box on a windows form which will change its display on event of changing combo selection. This is the method I wrote:
private void SurveyChooserCombo_SelectedIndexChanged(object sender, EventArgs e)
{
DAL dal = new DAL();
switch (SurveyChooserCombo.SelectedIndex)
{
case 0:
SrNo = 1;
break;
case 1:
SrNo = 2;
break;
case 2:
SrNo = 3;
break;
default:
SrNo = 3;
break;
}
It doesn't do the job.
Please help me find why.
TIA,
sea#
|
|
|
|
|
|
"doesn't do the job" is very vague, what doesn't work in particular?
modified 12-Sep-18 21:01pm.
|
|
|
|
|
SrNo, which is an int represents survey no. Each time I change the item in combo, it is changed.
"doesn't do the job" means SurveyChooserCombo.SelectedIndex seems to be left unchanged.
When I run the application the form doesn't change the display as expected.
Also cannot run it in debug mode, as I get "there is no source code available for current location", when trying to run over method more then once- to make the change in index come true.
sea#
|
|
|
|
|
Are you sure you have added event handler?
i.e.
comboBox.SelectedIndexChanged+=new SelectionChangeHandler(<<your method>>)
???
This is done automatically by Visual Designer - simply naming method SurveyChooserCombo_SelectedIndexChanged does not automatically associate it with the control...
- Another possibility is that the event may not be fired if combo box list style is not a selection from drop-down list but a mixture of type-in and select from the list...
Hope this helps.
Regards
JP
|
|
|
|
|
Petras J. wrote:
Are you sure you have added event handler?
i.e.
comboBox.SelectedIndexChanged+=new SelectionChangeHandler(<<your method="">>)
???
I do have event handler.
Petras J. wrote:
- Another possibility is that the event may not be fired if combo box list style is not a selection from drop-down list but a mixture of type-in and select from the list...
it is just an ordinary drop-down list. Nothing complicated.
What else should I do to make it change once selction changed?
TIA,
sea#
|
|
|
|
|
Wrote this code:
private void SurveyChooserCombo_SelectedIndexChanged(object sender, EventArgs e)
{
if (SurveyChooserCombo.Text.Equals("Survey1"))
SrNo = 1;
else if (SurveyChooserCombo.Text.Equals("Survey2"))
SrNo = 2;
else if (SurveyChooserCombo.Text.Equals("Survey3"))
SrNo = 3;
else
SrNo = 3;
GetResults (SrNo);
}
stil event is not fired, dsiplay doesnot changed.
|
|
|
|