|
Wouldn't it be better to ask the people who publish this program?
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
hi guys ..
i need ur help
my Graduation Project remote control pc via mobile
i can't write code in windows phone7 control mouse and
keyboard
begin i'm writing code in c# i have code (remote client and remote server ) but i can't convert it to windows phone7
help me plz
|
|
|
|
|
Try some of these articles[^].
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
thnx so much
|
|
|
|
|
I am attempting to create a Windows Form application that will select a window based on it handle. No problem here doing that.
Afterwards, the I used Thread.Sleep() to buy some time, then use SendKeys.Send(). Of course, without doing the work here on another Thread, my UI will hang on my application while the Thread sleeps.
Therefore, I wanted to create another Thread, which I did, and encapsulate the above work (Thread.Sleep and SendKeys.Send) to a method and send it to the Thread. Unfortunately, the SendKeys doesn't end up sending any text as a result.
Am I missing something rather remedial here? Does the SendKeys() have to come from the primary thread? I am also selecting another window, not my application, for the SendKeys() to target.
Thread oThread = new Thread(new ThreadStart(sendTheKeys());
public static void sendTheKeys()
{
Thread.Sleep(5000);
SendKeys.Send("Simple Text Message here!");
}
|
|
|
|
|
Do you have any proof the thread got executed? I don't see any oThread.Start() ...
BTW1: if that is all you need, you could as well use a System.Windows.Forms.Timer, have it tick once (after 5 sec), and stop it inside its Tick handler (which runs on the main thread).
BTW2: if the process you want to send data to is one your app has launched, you might be better off using Process.WaitForInputIdle() rather than delaying for a fixed amount of time.
|
|
|
|
|
It did, I started the thread using the exact code immediately after.
For further thought, I also tried using Task.Factory.StartNew();
I inserted some test code and the thread seems to execute just no SendKeys output.
For simplicity I will probably just set a timer for my couple of tasks, however at this point I'm just wondering if I'm doing something wrong or if it must run on the primary thread.
|
|
|
|
|
I performed a little experiment and indeed SendKeys seems to fail when called by anything but the main thread; I don't recall having read about such requirement though.
|
|
|
|
|
Do you happen to know of a function / method I could use that will run off of a secondary thread?
Thank you for the help.
|
|
|
|
|
I have no idea what you mean here.
This was my test code:
public class CPTest_SendKeys : CPTest {
public override void Test(int arg) {
if (arg==1) {
runner();
} else {
BackgroundWorker bgw=new BackgroundWorker();
bgw.DoWork+=new DoWorkEventHandler(bgw_DoWork);
bgw.RunWorkerAsync();
}
}
void bgw_DoWork(object sender, DoWorkEventArgs e) {
runner();
}
private void runner() {
Process p=Process.Start("notepad.exe");
p.WaitForInputIdle();
SendKeys.Send("abcd");
log("sent");
}
}
|
|
|
|
|
Oh. All I'm asking is, absent of SendKeys, is there any other class or WinAPI that offers sending keystrokes to another application? Whether it be that the application has to be the foreground application or not?
|
|
|
|
|
I see.
I know of: SendKeys, SendInput (in user32.dll), and SendMessage (also in user32.dll).
The latter takes a hWnd (and needs a message such as WM_KEYDOWN), the other two implicitly address the active window. I tend to use SendKeys for simulated keyboard input, SendInput only for mouse operations.
|
|
|
|
|
class foo<T>{
T myT;
foo(T t){myT=new T(t);}
}
of course the above fails because i havn't restricted T to have new.
I don't want to copy by reference the T passed in.
Is it possible to have 1 class which constructs correctly where possible, but also accepts basic types, which don't contain a copy constructor?
class foo<T> where T:new(){
T myT;
foo(T t){myT=new T(t);}
}
class foo<T> where T: NOT new(){
T myT;
foo(T t){myT=t;}
}
so that foo<int>, foo<otherClass> both work.
|
|
|
|
|
Test to see if type isClass[^]
"You get that on the big jobs."
|
|
|
|
|
Hi
I'm working on new winform project using EF and i'm looking for best approach to pass an entity between forms as parameter.
In main form i have a grid populated with i.e. customers from dbcontext like:
var db = new context();
grid.datasource = db.Customers.toList();
db.dispose();
Then i want to edit grid selected row(presents a customer record) in a new form(Detail form).
I get selected customer by this:
Customer editCustomer = (Customer)grid.selectedRows[0].dataBoundItem;
and then pass the 'editCustomer' to a new instance of Detail form constructor.
Now my problem is how to save editCustomer changes made in Detail form? (with consideration of in Detail form the editCustomer have Detached state). this really confusing me
Please help me.
Thanks.
|
|
|
|
|
The easy way is to just pass the customer ID, create a new context and retrieve the customer record using the id and manage from there.
I nicer solution would be to implement MVVM and data binding. There'd be a learning curve if you're not already familiar with the concepts.
"You get that on the big jobs."
|
|
|
|
|
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I tried to generate a db from EDM, I created my SDM and I generated the database but it is empty, there's no table
|
|
|
|
|
Perhaps if you gave more detail and explained what EDM and SDM are, you might get some responses.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Hi All !
the size of my exe file is about 1.5 mb .I just used Microsoft.Office.Interop.Excel.dll and Word in preferences.
thanks for any help me to introduce a way to decrease the size of Exe file.
Regards !
|
|
|
|
|
Normally in a small application, the app's Icon (and any other included images/resources) are the biggest bloat.
|
|
|
|
|
Obfuscation will not only make the exe smaller but also protect your IP.
"You get that on the big jobs."
|
|
|
|
|
|
void GetDataFromDatabaseSortedByCustomerName()
{
int customerId;
}
Obfuscated
void a()
{
int a;
}
The obfuscated IL code is going to be smaller
"You get that on the big jobs."
modified 1-Apr-12 23:42pm.
|
|
|
|
|
Trouble is, it does absolutely sod all to protect your IP.
|
|
|
|